You are not logged in.
Pages: 1
i just got a thinkpad x120e. there is no led for when the caps lock key is on.
does anyone know if there is a way to show an icon in the wibox when the caps lock is on?
Offline
Well, you could use a combination of xbindkeys and awesome-client.
You will need a icon named "capslockicon" of widgettype "imagebox".
Bind the following shell script to Caps_Lock in .xbindkeysrc.
#! /bin/bash
status=$(cat /tmp/capslock)
case $status in
0)
echo 1 > /tmp/capslock
echo "capslockicon.visible = true" | awesome-client
;;
1)
echo 0 > /tmp/capslock
echo "capslockicon.visible = false" | awesome-client
;;
*)
echo 1 > /tmp/capslock
echo "capslockicon.visible = true" | awesome-client
;;
esac
I haven't tried this yet, so let me know if it doesn't work or something.
Cheers
He who says A doesn't have to say B. He can also recognize that A was false.
Offline
You could also check it with a little help from xset
#!/bin/bash
# Here's a example in bash, doesn't do much more then just echo on or off
CAPS_STATE=$(xset q)
PATTERN='Caps Lock:\s+(on|off)'
if [[ "$CAPS_STATE" =~ $PATTERN ]]; then
# Match
echo ${BASH_REMATCH[1]}
exit 0
else
# Nothing...
exit 1
fi
You could call that shellscript for your widget to get caps lock's state.
Or you could run xset q directly from lua in your widget and
take care of it there and have one script less to care about
Since I haven't done anything else in lua other than the settings
for awesome.. this can likely be done better
function caps_is()
local f = io.popen("xset q")
for line in f:lines() do
local _, _, caps_state = string.find(line, 'Caps Lock:%s+(%w+)')
if caps_state ~= nil then
f:close()
return caps_state
end
end
f:close()
return "unknown"
end
A tiling window manager simply manages your windows, not just letting you have em
:: Configs etc @GitHub
Offline
Pages: 1