A lightweight GNOME Shell extension that displays the current Fn Lock state directly in the GNOME status panel.
It is designed primarily for keyboards and laptops where the Fn Lock state is handled in software rather than exposed through a dedicated hardware Fn Lock key or standard keyboard indicator.
The extension uses keyd layer events to determine whether the Fn/media layer is active and reflects that state in the GNOME Shell panel.
Note
This extension does not track hardware Fn Lock.
github_demo.mp4
Many laptop keyboards do not expose their Fn Lock state through a standard Linux input event.
For example, a laptop may use:
Fn + F1–F12for hardware/media functionsFn Lockto switch the behavior of the function-row keys- A firmware-specific implementation that is not visible to GNOME Shell
In these situations, a normal GNOME Shell extension cannot reliably determine whether Fn Lock is enabled by simply monitoring keyboard events.
This project instead relies on keyd to represent the Fn/media state as a software layer.
When the layer is toggled, keyd maintains the corresponding layer state. fn-lock-indicator monitors that state and uses it as the source of truth for the Fn Lock indicator.
In other words:
Keyboard
│
▼
keyd
│
│ layer state / layer events
▼
fn-lock-indicator
│
▼
GNOME Shell status panel
The extension therefore does not attempt to detect a physical Fn Lock state from the keyboard itself.
keyd is available directly from the official extra repository.
sudo pacman -S keyd
sudo systemctl enable --now keydVerify that the service is running:
systemctl status keydOn Fedora, keyd can be installed through the alternateved/keyd COPR repository.
sudo dnf copr enable alternateved/keyd
sudo dnf install keyd
sudo systemctl enable --now keydVerify that the service is running:
systemctl status keydOn newer Ubuntu releases, keyd may be available directly through apt:
sudo apt update
sudo apt install keyd
sudo systemctl enable --now keydIf the package is unavailable for your Ubuntu release, keyd can be built from source:
sudo apt install build-essential git
git clone https://github.com/rvaiya/keyd.git
cd keyd
make
sudo make install
sudo systemctl enable --now keydVerify the service:
systemctl status keydOnce keyd is installed, configure your keyboard in:
/etc/keyd/default.conf
The exact configuration depends on your keyboard and desired key mappings.
The important part for fn-lock-indicator is that the configuration provides a toggleable keyd layer representing the Fn/media-key state.
For example:
[ids]
*
[main]
# M4 toggles media layer
scrolldown = overload(media_layer, toggle(media_layer))
[media_layer]
# G14 Media Keys
f1 = mute
f2 = previoussong
f3 = playpause
f4 = nextsong
f5 = f15
f6 = A-sysrq
f7 = brightnessdown
f8 = brightnessup
f9 = M-p
f10 = f21
f11 = sleep
f12 = rfkillAfter modifying the configuration, reload keyd:
sudo keyd reloadYou can verify the daemon with:
systemctl status keydThe layer used by the extension should correspond to the layer representing your Fn/media-key state.
For example:
[media_layer]
...If your configuration uses a different layer name, make sure the extension's configuration is adjusted accordingly.
Installing from a packaged release does not require developer tools or manual schema compilation.
-
Download the latest
.shell-extension.zipfile from the Releases page. -
Install the extension using the GNOME Extensions CLI:
gnome-extensions install --force fn-lock-indicator@infiniti151.github.io.shell-extension.zip
-
Reload your GNOME Session:
X11: Press Alt + F2 to open the Run Command dialog, type r and then Enter to restart the Gnome Shell.
Wayland: Logout using the GUI or with
gnome-session-quit --logout --no-promptin the terminal. -
Enable the extension:
gnome-extensions enable fn-lock-indicator@infiniti151.github.io
Clone the repository:
git clone https://github.com/Infiniti151/fn-lock-indicator.git
cd fn-lock-indicatorThe project provides a small Makefile to simplify common operations.
| Command | Description |
|---|---|
make install |
Installs the extension and compiles its GSettings schema |
make enable |
Enables the GNOME Shell extension |
make disable |
Disables the GNOME Shell extension |
make uninstall |
Removes the installed extension |
A typical first-time setup is therefore:
-
Install
make install
-
Reload your GNOME Session:
X11: Press Alt + F2 to open the Run Command dialog, type r and then Enter to restart the Gnome Shell.
Wayland: Logout using the GUI or with
gnome-session-quit --logout --no-promptin the terminal. -
Enable
make enable
This project is distributed under the license included in LICENSE.
See the LICENSE file for the complete license text and applicable terms.