Added command directive 'title_format'.

This directive will be used to customize the window title.
This commit is contained in:
Ingo Bürk 2015-06-10 18:59:45 +02:00
parent 9ad9af6dee
commit 55e8d06ee4
4 changed files with 23 additions and 1 deletions

View File

@ -276,6 +276,12 @@ void cmd_move_scratchpad(I3_CMD);
*/ */
void cmd_scratchpad_show(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>' * Implementation of 'rename workspace <name> to <name>'
* *

View File

@ -37,6 +37,7 @@ state INITIAL:
'rename' -> RENAME 'rename' -> RENAME
'nop' -> NOP 'nop' -> NOP
'scratchpad' -> SCRATCHPAD 'scratchpad' -> SCRATCHPAD
'title_format' -> TITLE_FORMAT
'mode' -> MODE 'mode' -> MODE
'bar' -> BAR 'bar' -> BAR
@ -374,6 +375,10 @@ state SCRATCHPAD:
'show' 'show'
-> call cmd_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>] # bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [<bar_id>]
state BAR: state BAR:
bar_type = 'hidden_state' bar_type = 'hidden_state'

View File

@ -1899,6 +1899,17 @@ void cmd_scratchpad_show(I3_CMD) {
ysuccess(true); 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>' * Implementation of 'rename workspace [<name>] to <name>'
* *

View File

@ -144,7 +144,7 @@ is(parser_calls("\nworkspace test"),
################################################################################ ################################################################################
is(parser_calls('unknown_literal'), 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: Your command: unknown_literal\n" .
"ERROR: ^^^^^^^^^^^^^^^", "ERROR: ^^^^^^^^^^^^^^^",
'error for unknown literal ok'); 'error for unknown literal ok');