Make single bar handle multiple outputs

This commit is contained in:
Mikkel Oscar Lyderik 2016-02-22 17:27:17 +01:00
parent e19e32cf81
commit 6d57f03028
7 changed files with 160 additions and 71 deletions

View file

@ -35,7 +35,7 @@ int main(int argc, char **argv) {
};
const char *usage =
"Usage: swaybar [options...] <output>\n"
"Usage: swaybar [options...]\n"
"\n"
" -h, --help Show help message and quit.\n"
" -v, --version Show the version number and quit.\n"
@ -95,15 +95,9 @@ int main(int argc, char **argv) {
}
}
if (argc == optind) {
sway_abort("No output index provided");
}
int desired_output = atoi(argv[optind]);
signal(SIGTERM, sig_handler);
bar_setup(&swaybar, socket_path, bar_id, desired_output);
bar_setup(&swaybar, socket_path, bar_id);
free(socket_path);
free(bar_id);