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/
Keybinding by default:
<Control> + Escape
Custom keybinding workaround (TBD: prefs)
cat << EOF | dconf load /org/gnome/shell/extensions/fnlock/
[/]
keybinding=['<Control>Escape']
EOF
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.
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