swaybar: show hidden bar on key event

Since wayland does not currently allow swaybar to create global
keybinds, this is handled within sway and sent to the bar using a custom
event, so as not to pollute existing events, called bar_state_update.
This commit is contained in:
Ian Fan 2018-10-12 21:14:52 +01:00
parent bcc61e5147
commit 2f1fd80726
8 changed files with 66 additions and 7 deletions

View file

@ -30,6 +30,9 @@ enum ipc_command_type {
IPC_EVENT_BINDING = ((1<<31) | 5),
IPC_EVENT_SHUTDOWN = ((1<<31) | 6),
IPC_EVENT_TICK = ((1<<31) | 7),
// sway-specific event types
IPC_EVENT_BAR_STATE_UPDATE = ((1<<31) | 20),
};
#endif

View file

@ -191,6 +191,7 @@ struct bar_config {
* In "show" mode, it will always be shown on top of the active workspace.
*/
char *hidden_state;
bool visible_by_modifier; // only relevant in "hide" mode
/**
* Id name used to identify the bar through IPC.
*

View file

@ -15,6 +15,7 @@ void ipc_event_workspace(struct sway_workspace *old,
struct sway_workspace *new, const char *change);
void ipc_event_window(struct sway_container *window, const char *change);
void ipc_event_barconfig_update(struct bar_config *bar);
void ipc_event_bar_state_update(struct bar_config *bar);
void ipc_event_mode(const char *mode, bool pango);
void ipc_event_shutdown(const char *reason);
void ipc_event_binding(struct sway_binding *binding);

View file

@ -32,6 +32,7 @@ struct swaybar_config {
char *sep_symbol;
char *mode;
char *hidden_state;
char *modifier;
bool strip_workspace_numbers;
bool binding_mode_indicator;
bool wrap_scroll;