|
|
@ -22,7 +22,6 @@ void sway_terminate(int code) {
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
char *socket_path = NULL;
|
|
|
|
char *socket_path = NULL;
|
|
|
|
char *bar_id = NULL;
|
|
|
|
|
|
|
|
bool debug = false;
|
|
|
|
bool debug = false;
|
|
|
|
|
|
|
|
|
|
|
|
static struct option long_options[] = {
|
|
|
|
static struct option long_options[] = {
|
|
|
@ -59,7 +58,7 @@ int main(int argc, char **argv) {
|
|
|
|
socket_path = strdup(optarg);
|
|
|
|
socket_path = strdup(optarg);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'b': // Type
|
|
|
|
case 'b': // Type
|
|
|
|
bar_id = strdup(optarg);
|
|
|
|
swaybar.id = strdup(optarg);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'v':
|
|
|
|
case 'v':
|
|
|
|
fprintf(stdout, "swaybar version " SWAY_VERSION "\n");
|
|
|
|
fprintf(stdout, "swaybar version " SWAY_VERSION "\n");
|
|
|
@ -80,7 +79,7 @@ int main(int argc, char **argv) {
|
|
|
|
wlr_log_init(WLR_ERROR, NULL);
|
|
|
|
wlr_log_init(WLR_ERROR, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!bar_id) {
|
|
|
|
if (!swaybar.id) {
|
|
|
|
wlr_log(WLR_ERROR, "No bar_id passed. "
|
|
|
|
wlr_log(WLR_ERROR, "No bar_id passed. "
|
|
|
|
"Provide --bar_id or let sway start swaybar");
|
|
|
|
"Provide --bar_id or let sway start swaybar");
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
@ -96,13 +95,12 @@ int main(int argc, char **argv) {
|
|
|
|
|
|
|
|
|
|
|
|
signal(SIGTERM, sig_handler);
|
|
|
|
signal(SIGTERM, sig_handler);
|
|
|
|
|
|
|
|
|
|
|
|
if (!bar_setup(&swaybar, socket_path, bar_id)) {
|
|
|
|
if (!bar_setup(&swaybar, socket_path)) {
|
|
|
|
free(socket_path);
|
|
|
|
free(socket_path);
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
free(socket_path);
|
|
|
|
free(socket_path);
|
|
|
|
free(bar_id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bar_run(&swaybar);
|
|
|
|
bar_run(&swaybar);
|
|
|
|
bar_teardown(&swaybar);
|
|
|
|
bar_teardown(&swaybar);
|
|
|
|