2018-12-10 02:10:41 +11:00
|
|
|
#define _POSIX_C_SOURCE 200809L
|
2018-03-30 08:20:03 +11:00
|
|
|
#include <string.h>
|
2018-12-10 02:10:41 +11:00
|
|
|
#include "config.h"
|
2018-03-30 08:20:03 +11:00
|
|
|
#include "sway/commands.h"
|
2018-12-10 02:10:41 +11:00
|
|
|
#include "sway/config.h"
|
|
|
|
#include "log.h"
|
2018-03-30 08:20:03 +11:00
|
|
|
|
|
|
|
struct cmd_results *bar_cmd_icon_theme(int argc, char **argv) {
|
2018-12-10 02:10:41 +11:00
|
|
|
#if HAVE_TRAY
|
|
|
|
struct cmd_results *error = NULL;
|
|
|
|
if ((error = checkarg(argc, "icon_theme", EXPECTED_EQUAL_TO, 1))) {
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
2019-01-21 05:51:12 +11:00
|
|
|
sway_log(SWAY_DEBUG, "[Bar %s] Setting icon theme to %s",
|
2018-12-10 02:10:41 +11:00
|
|
|
config->current_bar->id, argv[0]);
|
|
|
|
free(config->current_bar->icon_theme);
|
|
|
|
config->current_bar->icon_theme = strdup(argv[0]);
|
2019-01-11 10:27:21 +11:00
|
|
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
2018-12-10 02:10:41 +11:00
|
|
|
#else
|
2019-01-11 10:27:21 +11:00
|
|
|
return cmd_results_new(CMD_INVALID,
|
2018-12-10 02:10:41 +11:00
|
|
|
"Sway has been compiled without tray support");
|
|
|
|
#endif
|
2018-03-30 08:20:03 +11:00
|
|
|
}
|