diff options
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c index 13bc7dc2..4af9186a 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -79,6 +79,7 @@ static sway_cmd bar_cmd_position; | |||
79 | static sway_cmd bar_cmd_separator_symbol; | 79 | static sway_cmd bar_cmd_separator_symbol; |
80 | static sway_cmd bar_cmd_status_command; | 80 | static sway_cmd bar_cmd_status_command; |
81 | static sway_cmd bar_cmd_strip_workspace_numbers; | 81 | static sway_cmd bar_cmd_strip_workspace_numbers; |
82 | static sway_cmd bar_cmd_swaybar_command; | ||
82 | static sway_cmd bar_cmd_tray_output; | 83 | static sway_cmd bar_cmd_tray_output; |
83 | static sway_cmd bar_cmd_tray_padding; | 84 | static sway_cmd bar_cmd_tray_padding; |
84 | static sway_cmd bar_cmd_workspace_buttons; | 85 | static sway_cmd bar_cmd_workspace_buttons; |
@@ -1918,6 +1919,23 @@ static struct cmd_results *bar_cmd_strip_workspace_numbers(int argc, char **argv | |||
1918 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 1919 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
1919 | } | 1920 | } |
1920 | 1921 | ||
1922 | static struct cmd_results *bar_cmd_swaybar_command(int argc, char **argv) { | ||
1923 | struct cmd_results *error = NULL; | ||
1924 | if ((error = checkarg(argc, "swaybar_command", EXPECTED_AT_LEAST, 1))) { | ||
1925 | return error; | ||
1926 | } | ||
1927 | |||
1928 | if (!config->current_bar) { | ||
1929 | return cmd_results_new(CMD_FAILURE, "swaybar_command", "No bar defined."); | ||
1930 | } | ||
1931 | |||
1932 | free(config->current_bar->swaybar_command); | ||
1933 | config->current_bar->swaybar_command = join_args(argv, argc); | ||
1934 | sway_log(L_DEBUG, "Using custom swaybar command: %s", config->current_bar->swaybar_command); | ||
1935 | |||
1936 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | ||
1937 | } | ||
1938 | |||
1921 | static struct cmd_results *bar_cmd_tray_output(int argc, char **argv) { | 1939 | static struct cmd_results *bar_cmd_tray_output(int argc, char **argv) { |
1922 | sway_log(L_ERROR, "warning: tray_output is not supported on wayland"); | 1940 | sway_log(L_ERROR, "warning: tray_output is not supported on wayland"); |
1923 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 1941 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
@@ -1986,6 +2004,7 @@ static struct cmd_handler bar_handlers[] = { | |||
1986 | { "separator_symbol", bar_cmd_separator_symbol }, | 2004 | { "separator_symbol", bar_cmd_separator_symbol }, |
1987 | { "status_command", bar_cmd_status_command }, | 2005 | { "status_command", bar_cmd_status_command }, |
1988 | { "strip_workspace_numbers", bar_cmd_strip_workspace_numbers }, | 2006 | { "strip_workspace_numbers", bar_cmd_strip_workspace_numbers }, |
2007 | { "swaybar_command", bar_cmd_swaybar_command }, | ||
1989 | { "tray_output", bar_cmd_tray_output }, | 2008 | { "tray_output", bar_cmd_tray_output }, |
1990 | { "tray_padding", bar_cmd_tray_padding }, | 2009 | { "tray_padding", bar_cmd_tray_padding }, |
1991 | { "workspace_buttons", bar_cmd_workspace_buttons }, | 2010 | { "workspace_buttons", bar_cmd_workspace_buttons }, |