mirror of
https://github.com/swaywm/sway.git
synced 2026-04-26 06:46:26 -04:00
criteria: Add keyboard shortcuts inhibitor selector
Add a criteria selector that allows to match presence and state of keyboard shortcuts inhibitors on views. This allows to give visual feedback to the user on the state of an inhibitor through e.g.: for_window [shortcuts_inhibitor=inactive] title_format !-%title for_window [shortcuts_inhibitor=active] title_format !+%title for_window [shortcuts_inhibitor=present] title_format !%title for_window [shortcuts_inhibitor=absent] title_format %title Beware: present in the example above overrides inactive and active criteria because when active or inactive an inhbitor is obviously present. Ordering does matter here. Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
This commit is contained in:
parent
aa48b926be
commit
224576afcc
3 changed files with 79 additions and 1 deletions
|
|
@ -24,6 +24,14 @@ struct pattern {
|
|||
pcre *regex;
|
||||
};
|
||||
|
||||
enum criteria_keyboard_shortcuts_inhibitor {
|
||||
// implicit: C_KEYBOARD_SHORTCUTS_INHIBITOR_UNSPEC = 0,
|
||||
C_KEYBOARD_SHORTCUTS_INHIBITOR_PRESENT = 1,
|
||||
C_KEYBOARD_SHORTCUTS_INHIBITOR_ABSENT,
|
||||
C_KEYBOARD_SHORTCUTS_INHIBITOR_ACTIVE,
|
||||
C_KEYBOARD_SHORTCUTS_INHIBITOR_INACTIVE,
|
||||
};
|
||||
|
||||
struct criteria {
|
||||
enum criteria_type type;
|
||||
char *raw; // entire criteria string (for logging)
|
||||
|
|
@ -47,6 +55,7 @@ struct criteria {
|
|||
char urgent; // 'l' for latest or 'o' for oldest
|
||||
struct pattern *workspace;
|
||||
pid_t pid;
|
||||
enum criteria_keyboard_shortcuts_inhibitor keyboard_shortcuts_inhibitor;
|
||||
};
|
||||
|
||||
bool criteria_is_empty(struct criteria *criteria);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue