mirror of
https://github.com/NickHu/sway
synced 2025-01-14 08:01:12 +01:00
Make swaybar check command arguments
This commit is contained in:
parent
1825cf32bf
commit
ce8b71415f
1 changed files with 8 additions and 0 deletions
|
@ -368,6 +368,10 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!bar_id) {
|
||||||
|
sway_abort("No bar_id passed. Provide --bar_id or let sway start swaybar");
|
||||||
|
}
|
||||||
|
|
||||||
registry = registry_poll();
|
registry = registry_poll();
|
||||||
|
|
||||||
if (!registry->desktop_shell) {
|
if (!registry->desktop_shell) {
|
||||||
|
@ -382,6 +386,10 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
socketfd = ipc_open_socket(socket_path);
|
socketfd = ipc_open_socket(socket_path);
|
||||||
|
|
||||||
|
if (argc == optind) {
|
||||||
|
sway_abort("No output index provided");
|
||||||
|
}
|
||||||
|
|
||||||
int desired_output = atoi(argv[optind]);
|
int desired_output = atoi(argv[optind]);
|
||||||
sway_log(L_INFO, "Using output %d of %d", desired_output, registry->outputs->length);
|
sway_log(L_INFO, "Using output %d of %d", desired_output, registry->outputs->length);
|
||||||
struct output_state *output = registry->outputs->items[desired_output];
|
struct output_state *output = registry->outputs->items[desired_output];
|
||||||
|
|
Loading…
Reference in a new issue