aboutsummaryrefslogtreecommitdiff
path: root/swaybar/main.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-10-14 15:13:50 +0200
committerGitHub <noreply@github.com>2018-10-14 15:13:50 +0200
commit4a05fbf8ab364657763b1d1058bdf9b4c2727b76 (patch)
treec405121528d191ba74fe329fdb18093810d9b73c /swaybar/main.c
parentabde9d6627483256ccfd20bdeeaa52d7790b0426 (diff)
parent85dd36e92b2fb3d4b5fefa36927abf8f35f84c5c (diff)
Merge pull request #2751 from ianyfan/swaybar
Bar mode/hidden_state events
Diffstat (limited to 'swaybar/main.c')
-rw-r--r--swaybar/main.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/swaybar/main.c b/swaybar/main.c
index db204f4a..2672abef 100644
--- a/swaybar/main.c
+++ b/swaybar/main.c
@@ -22,7 +22,6 @@ void sway_terminate(int code) {
int main(int argc, char **argv) {
char *socket_path = NULL;
- char *bar_id = NULL;
bool debug = false;
static struct option long_options[] = {
@@ -59,7 +58,7 @@ int main(int argc, char **argv) {
socket_path = strdup(optarg);
break;
case 'b': // Type
- bar_id = strdup(optarg);
+ swaybar.id = strdup(optarg);
break;
case 'v':
fprintf(stdout, "swaybar version " SWAY_VERSION "\n");
@@ -80,7 +79,7 @@ int main(int argc, char **argv) {
wlr_log_init(WLR_ERROR, NULL);
}
- if (!bar_id) {
+ if (!swaybar.id) {
wlr_log(WLR_ERROR, "No bar_id passed. "
"Provide --bar_id or let sway start swaybar");
return 1;
@@ -96,13 +95,12 @@ int main(int argc, char **argv) {
signal(SIGTERM, sig_handler);
- if (!bar_setup(&swaybar, socket_path, bar_id)) {
+ if (!bar_setup(&swaybar, socket_path)) {
free(socket_path);
return 1;
}
free(socket_path);
- free(bar_id);
bar_run(&swaybar);
bar_teardown(&swaybar);