i3blocks.conf
command=/home/kai/.scripts/$BLOCK_NAME
vim ~/.config/i3blocks/config
[caps-lock]
command=xset -q | grep Caps | awk '{ print $2, $4 }'
interval=once
signal=10
[num-lock]
command=xset -q | grep Num | awk '{ print $6, $8 }'
interval=once
signal=10
:wq
--------------------------------------------
another one
--------------------------------------------------
vim ~/.config/i3blocks/config
i3blocks.conf
[keynotify]
instance=caps
interval=once
signal=10
[keynotify]
instance=num
interval=once
signal=10
:wq
script dir >>
vim ~/.scripts/
keynotify
#!/bin/sh
# Define output variables
# Set kbinput empty to use the first input it finds
kbinput=
notify=""
# Parse status to shortened format
# Works with both X11 and Wayland
case $BLOCK_INSTANCE in
"caps")
state=$(cat /sys/class/leds/input${kbinput}*capslock/brightness)
[ "$state" -gt "0" ] && notify="CAPS"
;;
"num")
state=$(cat /sys/class/leds/input${kbinput}*numlock/brightness)
[ "$state" -gt "0" ] && notify="NUM"
;;
"scr")
state=$(cat /sys/class/leds/input${kbinput}*scrolllock/brightness)
[ "$state" -gt "0" ] && notify="SCR"
;;
esac
# Print a label if needed
if [ -n "$notify" ]; then
printf "$notify\n"
printf "$notify\n"
exit 33
fi
:wq
-------------------------------------------------------------------------------
Comments
Post a Comment