Added command directive 'title_format'.
This directive will be used to customize the window title.
This commit is contained in:
parent
9ad9af6dee
commit
55e8d06ee4
|
@ -276,6 +276,12 @@ void cmd_move_scratchpad(I3_CMD);
|
|||
*/
|
||||
void cmd_scratchpad_show(I3_CMD);
|
||||
|
||||
/**
|
||||
* Implementation of 'title_format <format>'
|
||||
*
|
||||
*/
|
||||
void cmd_title_format(I3_CMD, char *format);
|
||||
|
||||
/**
|
||||
* Implementation of 'rename workspace <name> to <name>'
|
||||
*
|
||||
|
|
|
@ -37,6 +37,7 @@ state INITIAL:
|
|||
'rename' -> RENAME
|
||||
'nop' -> NOP
|
||||
'scratchpad' -> SCRATCHPAD
|
||||
'title_format' -> TITLE_FORMAT
|
||||
'mode' -> MODE
|
||||
'bar' -> BAR
|
||||
|
||||
|
@ -374,6 +375,10 @@ state SCRATCHPAD:
|
|||
'show'
|
||||
-> call cmd_scratchpad_show()
|
||||
|
||||
state TITLE_FORMAT:
|
||||
format = string
|
||||
-> call cmd_title_format($format)
|
||||
|
||||
# bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [<bar_id>]
|
||||
state BAR:
|
||||
bar_type = 'hidden_state'
|
||||
|
|
|
@ -1899,6 +1899,17 @@ void cmd_scratchpad_show(I3_CMD) {
|
|||
ysuccess(true);
|
||||
}
|
||||
|
||||
/*
|
||||
* Implementation of 'title_format <format>'
|
||||
*
|
||||
*/
|
||||
void cmd_title_format(I3_CMD, char *format) {
|
||||
DLOG("setting title_format to %s\n", format);
|
||||
|
||||
cmd_output->needs_tree_render = true;
|
||||
ysuccess(true);
|
||||
}
|
||||
|
||||
/*
|
||||
* Implementation of 'rename workspace [<name>] to <name>'
|
||||
*
|
||||
|
|
|
@ -144,7 +144,7 @@ is(parser_calls("\nworkspace test"),
|
|||
################################################################################
|
||||
|
||||
is(parser_calls('unknown_literal'),
|
||||
"ERROR: Expected one of these tokens: <end>, '[', 'move', 'exec', 'exit', 'restart', 'reload', 'shmlog', 'debuglog', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'split', 'floating', 'mark', 'unmark', 'resize', 'rename', 'nop', 'scratchpad', 'mode', 'bar'\n" .
|
||||
"ERROR: Expected one of these tokens: <end>, '[', 'move', 'exec', 'exit', 'restart', 'reload', 'shmlog', 'debuglog', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'split', 'floating', 'mark', 'unmark', 'resize', 'rename', 'nop', 'scratchpad', 'title_format', 'mode', 'bar'\n" .
|
||||
"ERROR: Your command: unknown_literal\n" .
|
||||
"ERROR: ^^^^^^^^^^^^^^^",
|
||||
'error for unknown literal ok');
|
||||
|
|
Loading…
Reference in New Issue