Skip to content

didmar/keyd-indicator

Repository files navigation

Keyd Layer Status Indicator

A GNOME system tray indicator that displays the active keyd layers usng colored dots

Features

  • Real-time monitoring of keyd layer status
  • System tray icon that changes based on active layers
  • Context menu showing all currently active layers
  • Automatic reconnection if keyd daemon restarts
  • Tooltip displaying active layers

Prerequisites

  1. keyd must be installed and running

    • Install from: https://github.com/rvaiya/keyd
    • IMPORTANT: Add your user to the keyd group:
      sudo usermod -aG keyd $USER
      # Then log out and log back in for the change to take effect
  2. Python 3 with GTK bindings:

    # Debian/Ubuntu
    sudo apt install python3-gi gir1.2-appindicator3-0.1
    
    # Fedora
    sudo dnf install python3-gobject libappindicator-gtk3
  3. GNOME AppIndicator Extension (for modern GNOME Shell)

Installation

  1. Clone or download this repository
  2. Run the installation script:
    cd keyd-indicator
    ./install.sh

The script will:

  • Check dependencies
  • Install autostart entry for your user
  • Optionally install system-wide (requires sudo approval)

Local installation only: The indicator will be configured to autostart and you can run it with ./keyd_indicator.py

System-wide installation: Makes the keyd-indicator command available to all users

Usage

Starting manually

If you installed system-wide:

keyd-indicator

If you installed locally only:

./keyd_indicator.py

Autostart

The indicator will start automatically on login after installation.

Testing keyd connection

To verify that keyd's layer monitoring works:

keyd listen

Then switch between layers in your keyd configuration to see the output format.

How it works

The indicator connects to keyd using the keyd listen command, which streams layer state changes. The indicator parses these changes and updates the system tray icon and menu accordingly.

Troubleshooting

Indicator not visible

  • Ensure the GNOME AppIndicator extension is installed and enabled
  • Check if the indicator is running: ps aux | grep keyd-indicator

No layer changes detected

  • Verify keyd is running: systemctl status keyd
  • Test keyd listen manually: keyd listen
  • Check keyd configuration for layer definitions

Connection errors

  • The indicator will automatically try to reconnect if keyd restarts
  • Use the "Reconnect to keyd" menu option to manually reconnect

Virtual environment issues

If you get "Namespace AppIndicator3 not available" even though gir1.2-appindicator3-0.1 is installed:

  • Cause: You're running the script from within a Python virtual environment. AppIndicator3 GObject introspection files are system-only and not accessible from virtual environments.
  • Solution: Deactivate the virtual environment before running:
    deactivate  # Exit the venv
    keyd-indicator  # Run with system Python
  • The install script handles this automatically by installing to /usr/local/bin where it uses system Python

Customization

You can modify the icon behavior and parsing logic in keyd_indicator.py:

  • process_keyd_output() - Adjust parsing based on your keyd output format
  • update_indicator() - Customize icon changes

License

This project is provided as-is for use with keyd.

Disclaimer

This project's code was entirely AI-generated and does not reflect the level of quality, architectural decisions, or coding standards that I would typically provide as a software engineer.

About

A GNOME system tray indicator that displays the active keyd layers using colored dots

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published