goloshubov / fnlock-switch-tp-comp-usb-kb

Gnome Shell Extension - FnLk switch for Lenovo ThinkPad Compact USB Keyboard
GNU General Public License v3.0
2 stars 2 forks source link

fnlock-switch-tp-comp-usb-kb

GNOME Shell Extension for Lenovo ThinkPad Compact USB Keyboard that adds switch FnLock button to GNOME top panel https://extensions.gnome.org/extension/3939/fnlock-switch-thinkpad-compact-usb-keyboard/

\ Fn is unlocked\ screenshot00

Fn is locked (FnLk)\ screenshot01

Why?

There is an issue with Lenovo ThinkPad Compact USB Keyboard - FnLk doesn't work by pressing Fn+Esc in Linux. Manual toggling by writing 1|0 into /sys/bus/hid/devices/*17EF\:604*/fn_loc is possible though, thanks to: https://github.com/lentinj/tp-compact-keyboard.

Configuration

Notice that (GNOME) user should have write access to /sys/bus/hid/devices/*17EF\:604*/fn_loc

cat <<'EOF' >  /etc/udev/rules.d/99-thinkpad-compact-keyboard.rules 
SUBSYSTEM=="hid", ATTRS{idVendor}=="17ef", ATTRS{idProduct}=="604*", \
    RUN += "/bin/sh -c 'chown change_to_your_username \"/sys/$devpath/fn_lock\"'"
EOF

or

cat <<'EOF' >  /etc/udev/rules.d/99-thinkpad-compact-keyboard.rules 
SUBSYSTEM=="hid", ATTRS{idVendor}=="17ef", ATTRS{idProduct}=="604*", \
    RUN += "/bin/sh -c 'chmod 0666 \"/sys/$devpath/fn_lock\"'"
EOF