Page 4 of 4

Re: Is there any way to show a notification when Caps Lock is pressed?

Posted: Tue Nov 14, 2023 6:51 am
by fehlix
Jerry3904 wrote: Tue Nov 14, 2023 6:40 am Perfect, thanks. I had been using "On" and only switched to "1" in trying to fix it; but I never had the extra quote marks.
== compares double quoted strings strings

Re: Is there any way to show a notification when Caps Lock is pressed?

Posted: Tue Nov 14, 2023 11:55 am
by i_ri
hello fehlix and Jerry3904
Why ask for $key_caps_lock twice? is it necessary for translate On?
${if_match "${key_caps_lock}"=="On"}${color orange}${font :bold:size=14}caps LOCK is ON${color}$font${endif}

Re: Is there any way to show a notification when Caps Lock is pressed?

Posted: Tue Nov 14, 2023 12:31 pm
by Jerry3904
It works that way if translation is not a problem. I was thinking of increasing the size too.

Re: Is there any way to show a notification when Caps Lock is pressed?

Posted: Fri Jan 12, 2024 9:09 pm
by MXRobo
This kind of works for both insert buttons, but without the on-off indicator - if they have been toggled to function as insert keys, i.e. maybe fn for delete/insert, and the number-lock for 0/insert key.

Code: Select all

sh -c 'sleep 0.2; notify-send -t 5000  -i insert "Insert" $(xset -q | grep -oP "Insert:\s*\K(off|on)")'
This does work correctly for Num Lock:

Code: Select all

sh -c 'sleep 0.2; notify-send -t 5000  -i num-lock "Num Lock" $(xset -q | grep -oP "Num Lock:\s*\K(off|on)")'
Complicated coding. :p