diff options
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c index f90a5ae9..4e9630ef 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -76,6 +76,7 @@ static sway_cmd bar_cmd_height; | |||
76 | static sway_cmd bar_cmd_hidden_state; | 76 | static sway_cmd bar_cmd_hidden_state; |
77 | static sway_cmd bar_cmd_id; | 77 | static sway_cmd bar_cmd_id; |
78 | static sway_cmd bar_cmd_position; | 78 | static sway_cmd bar_cmd_position; |
79 | static sway_cmd bar_cmd_separator_symbol; | ||
79 | static sway_cmd bar_cmd_status_command; | 80 | static sway_cmd bar_cmd_status_command; |
80 | static sway_cmd bar_cmd_strip_workspace_numbers; | 81 | static sway_cmd bar_cmd_strip_workspace_numbers; |
81 | static sway_cmd bar_cmd_tray_output; | 82 | static sway_cmd bar_cmd_tray_output; |
@@ -1840,6 +1841,23 @@ static struct cmd_results *bar_cmd_position(int argc, char **argv) { | |||
1840 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 1841 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
1841 | } | 1842 | } |
1842 | 1843 | ||
1844 | static struct cmd_results *bar_cmd_separator_symbol(int argc, char **argv) { | ||
1845 | struct cmd_results *error = NULL; | ||
1846 | if ((error = checkarg(argc, "separator_symbol", EXPECTED_EQUAL_TO, 1))) { | ||
1847 | return error; | ||
1848 | } | ||
1849 | |||
1850 | if (!config->current_bar) { | ||
1851 | return cmd_results_new(CMD_FAILURE, "separator_symbol", "No bar defined."); | ||
1852 | } | ||
1853 | |||
1854 | free(config->current_bar->separator_symbol); | ||
1855 | config->current_bar->separator_symbol = strdup(argv[0]); | ||
1856 | sway_log(L_DEBUG, "Settings separator_symbol '%s' for bar: %s", config->current_bar->separator_symbol, config->current_bar->id); | ||
1857 | |||
1858 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | ||
1859 | } | ||
1860 | |||
1843 | static struct cmd_results *bar_cmd_status_command(int argc, char **argv) { | 1861 | static struct cmd_results *bar_cmd_status_command(int argc, char **argv) { |
1844 | struct cmd_results *error = NULL; | 1862 | struct cmd_results *error = NULL; |
1845 | if ((error = checkarg(argc, "status_command", EXPECTED_AT_LEAST, 1))) { | 1863 | if ((error = checkarg(argc, "status_command", EXPECTED_AT_LEAST, 1))) { |
@@ -1945,7 +1963,7 @@ static struct cmd_handler bar_handlers[] = { | |||
1945 | { "modifier", bar_cmd_modifier }, | 1963 | { "modifier", bar_cmd_modifier }, |
1946 | { "output", bar_cmd_output }, | 1964 | { "output", bar_cmd_output }, |
1947 | { "position", bar_cmd_position }, | 1965 | { "position", bar_cmd_position }, |
1948 | { "seperator_symbol", NULL }, | 1966 | { "separator_symbol", bar_cmd_separator_symbol }, |
1949 | { "status_command", bar_cmd_status_command }, | 1967 | { "status_command", bar_cmd_status_command }, |
1950 | { "strip_workspace_numbers", bar_cmd_strip_workspace_numbers }, | 1968 | { "strip_workspace_numbers", bar_cmd_strip_workspace_numbers }, |
1951 | { "tray_output", bar_cmd_tray_output }, | 1969 | { "tray_output", bar_cmd_tray_output }, |