You are not logged in.

#1 2015-07-06 07:13:44

grandmouse
Member
From: germany, bonn
Registered: 2005-05-14
Posts: 90

Thinkpad without capslock led

I could not find how to use the red Thinkpad i-dot as capslock indicator (missing on my Thinkpad E555).
So I wrote a little script and think it is useful enough to share.

#!/bin/sh
#/usr/local/bin/led
sleep 1
CAPS=$(xset -q | grep Caps | awk 'BEGIN {FS=":"};{print $3}' | tr -d ' 01'})
echo "0 $CAPS" > /proc/acpi/ibm/led

You must sudo it and of course make it executeable. I am in the wheel group and have this

 %wheel ALL=(ALL) NOPASSWD: /usr/local/bin/led

in /etc/sudoers

Keygrab capslock with command 'sudo led'.
Put 'sudo led' in .xprofile to have the right status after login (can be wrong before).

Offline

#2 2015-07-06 07:20:26

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Thinkpad without capslock led

Grep is redundant with Awk:

xset -q | awk '/Caps/ {print $4}'

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB