Page 1 of 1

'Caps Lock Indicator' in the Xfce panel

Posted: 4. Feb 2020, 21:47
by salix_user
I need 'Caps Lock Indicator' in the Xfce panel (SalixOS 14.2) to indicate status of 'Caps Lock'
I have xfce4-kbdleds-plugin but it is not very informative
Image

Re: 'Caps Lock Indicator' in the Xfce panel

Posted: 5. Feb 2020, 21:40
by ChuangTzu
That is the correct package, does it not display what you need, what's missing?

Re: 'Caps Lock Indicator' in the Xfce panel

Posted: 6. Feb 2020, 07:38
by salix_user
ChuangTzu wrote: 5. Feb 2020, 21:40 That is the correct package, does it not display what you need, what's missing?
It works properly but I hate it. :)
I would like something like this (its ppa)
I tried to compile it but without success.

Re: 'Caps Lock Indicator' in the Xfce panel

Posted: 6. Feb 2020, 18:41
by gapan
Well, that is an indicator panel plugin, which Xfce does not have. It only works in GNOME+derivatives.

I guess you could setup xfce4-genmon-plugin to display the caps lock information in whatever way you like. Here's a command to get caps lock status from the terminal:

Code: Select all

xset q | grep Caps | tr -s ' ' | cut -d ' ' -f 5
And here's xfce4-genmon-plugin's homepage:
https://docs.xfce.org/panel-plugins/xfce4-genmon-plugin

Re: 'Caps Lock Indicator' in the Xfce panel

Posted: 9. Feb 2020, 08:40
by salix_user
gapan wrote: 6. Feb 2020, 18:41 Well, that is an indicator panel plugin, which Xfce does not have. It only works in GNOME+derivatives
:) I am currently on Xubuntu_12.10 in LiveCD-mode. This indicator panel plugin works Ok.

Image

Its ppa says that the latest supported version of ubuntu is 18.04
So, I think it can work on SalixOS.
I repeat my request.

Re: 'Caps Lock Indicator' in the Xfce panel

Posted: 9. Feb 2020, 13:49
by gapan
Well, ubuntu includes xfce4-indicator-plugin, in order to stay compatible with their GNOME. We do not.

Re: 'Caps Lock Indicator' in the Xfce panel

Posted: 9. Feb 2020, 15:15
by salix_user
gapan wrote: 9. Feb 2020, 13:49 Well, ubuntu includes xfce4-indicator-plugin, in order to stay compatible with their GNOME. We do not.
In xubuntu, I have installed it by myself. People say that it works even in openbox.

Re: 'Caps Lock Indicator' in the Xfce panel

Posted: 10. Feb 2020, 20:00
by gapan
Openbox by itself has no panel, or tray or anything else. It's just a window manager.

But there are probably panels that you can run in openbox, or other window managers, that are built with indicator support in ubuntu, just like there is for xfce. In Salix, there are not.

Re: 'Caps Lock Indicator' in the Xfce panel

Posted: 11. Feb 2020, 12:59
by gapan
Here's a small script that you can use with xfce4-genmon-plugin.

Code: Select all

#!/bin/sh

# set to:
# 5 for CapsLock
# 9 for NumLock
# 13 for ScrollLock
FIELD=5

ICON_ON="/home/george/caps-lock-on.svg"
ICON_OFF="/home/george/caps-lock-off.svg"

STATUS=`xset q | grep Caps | tr -s ' ' | cut -d ' ' -f $FIELD`

if [[ $STATUS == "on" ]]; then
	echo "<img>${ICON_ON}</img>"
else
	echo "<img>${ICON_OFF}</img>"
fi
echo "<tool>CapsLock: $STATUS</tool>"
You can make it look however you want by setting the ICON_ON and ICON_OFF variables to any icon. In fact, you'll have to edit those to point to valid icons in your system. Or you can edit it to work for NumLock/ScrollLock. Set genmon plugin to run the script every 0.5 or 1 second or so and you're good to go.

Re: 'Caps Lock Indicator' in the Xfce panel

Posted: 11. Feb 2020, 21:00
by salix_user
gapan wrote: 11. Feb 2020, 12:59 Here's a small script that you can use with xfce4-genmon-plugin.
It works well. Thank you very much, gapan !