Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 1.66 KB

README.md

File metadata and controls

44 lines (36 loc) · 1.66 KB

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/


FnLock is active (locked)
screenshot01

FnLock is inactive (unlocked)
screenshot00

FnLock not found
screenshot01

Keybinding by default:
<Control> + Escape

Custom keybinding workaround (TBD: prefs)

cat << EOF | dconf load /org/gnome/shell/extensions/fnlock/
[/]
keybinding=['<Control>Escape']
EOF

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 0660 \"/sys/$devpath/fn_lock\"'"
EOF