unlock_indicator: only show caps lock and num lock (Thanks sandwm) (#324)

fixes #322
pull/326/head
Michael Stapelberg 2022-06-21 09:43:46 +02:00 committed by GitHub
parent 0171394882
commit 0d8ce95cd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -102,14 +102,15 @@ static void check_modifier_keys(void) {
continue; continue;
/* Replace certain xkb names with nicer, human-readable ones. */ /* Replace certain xkb names with nicer, human-readable ones. */
if (strcmp(mod_name, XKB_MOD_NAME_CAPS) == 0) if (strcmp(mod_name, XKB_MOD_NAME_CAPS) == 0) {
mod_name = "Caps Lock"; mod_name = "Caps Lock";
else if (strcmp(mod_name, XKB_MOD_NAME_ALT) == 0) } else if (strcmp(mod_name, XKB_MOD_NAME_NUM) == 0) {
mod_name = "Alt";
else if (strcmp(mod_name, XKB_MOD_NAME_NUM) == 0)
mod_name = "Num Lock"; mod_name = "Num Lock";
else if (strcmp(mod_name, XKB_MOD_NAME_LOGO) == 0) } else {
mod_name = "Super"; /* Show only Caps Lock and Num Lock, other modifiers (e.g. Shift)
* leak state about the password. */
continue;
}
char *tmp; char *tmp;
if (modifier_string == NULL) { if (modifier_string == NULL) {