Skip to main content

Kebihelp - The Universal Linux Key Bindings Helper

Kebihelp is an universal key-bindings helper for Linux, written in Python and initially inspired by AwesomeWM and its "Mod4+s" feature.

Click on the picture to zoom.

In this demo:

  • displays the helper
  • key is used to cycle through the tabs.
  • or is used to close it

Features

  • Facilities to import shortcuts from text files or QuickRef
  • Organize shortcuts with Tabs and Groups
  • Customizable design (colors, opacity, fonts, etc.)
  • Configuration in a single JSON file
  • Window Rules supported, to show the shortcuts for the current focused app

Installation

The package is published on PyPi. Installation with the virtual environment Venv:

mkdir ~/Tools/kebihelp && cd ~/Tools/kebihelp
python3 -m venv venv
source ./venv/bin/activate
pip install kebihelp
kebihelp show -a

Usage

The code is a Python 3 script using PyQT5. You just need to clone this repository and run pip3 install -r requirements.txt.

Then you have to launch kebihelp with the relevant options. The tool has 5 main commands:

  • import to import a file containing shortcuts
  • list to show the keybindings configured (console mode)
  • show to show the keybindings configured (GUI mode)

For each command, you can type kebihelp <command> -h to get help.

The configuration file is stored in ~/.config/kebihelp.json, which is a JSON file. You can add/modify your shortcuts there.

When the helper is launched with the kebihelp show, you can navigate through the tabs with the <TAB> key. The helper is closed with the <ESC> or q key.

Importing keybindings

Instead of entering manually each keybinding, you can import them from text files or from Quickref

The syntax to import is as follows:

kebihelp import -t <destination_tab> -s <path>
  • If the path is an URL starting with https://quickref.me/, the corresponding Quickref keybindings will be imported.
  • If the path is a local directory, all files will be analyzed recursively to search for keybindings to add, according to the following syntax:
::Group name::Key binding::Description::

Example:

kebihelp import -t Nvim -s ~/.config/nvim/

These can be anywhere in your various files. Example for Nvim:

You can also create a text file anywhere with your keybindings. This is what I did to register key bindings for Yazi (a command-line file manager):

Once imported, you can reorganize or modify the imported keybindings by editing the $HOME/.config/kebihelp.json file.

Customizing the format of keybindings

In the configuration file kebihelp.json, you are free to change the format of Keybindings. The default configuration is as follows:

    "importer": {
      "match_line": ".*::(.+?)::(.+?)::(.+?)::.*",
      "position_group": 1,
      "position_keybinding": 2,
      "position_label": 3
    },

Displaying keybindings (CLI)

The command kebihelp list will show all keybindings in your terminal.

You can also filter the list by using the option -t <tab name> to show only the keybindings for a particular tab.

Example:

# Show only Hyprland keybindings
kebihelp list -t Hyprland

Displaying keybindings (GUI)

To show a window with all keybindings, just type kebihelp show.

If you use a tiling window-manager, it's recommended to add a rule to set this window in floating mode.

Once displayed, you can navigate through the tabs by using the <TAB> key, and you can close the window using the <Esc> or q key.

The show command accepts also the option -t <tab> to display directory a particular tab instead of the default one.

Rules

In the kebihelp.json file, you can define rules to show a particular tab depending of the current focus. For instance, if you are in a Nvim session and you launch Kebihelp with a keybinding, it will show directly the "Nvim" keybindings.

Example:

 "Rules": {
    "_default": "Hyprland",
    "NVIM": "NeoVim"
  },

Here, the default tab will be the keybindings for Hyprland. However, if you are in NVIM (eg the class/title of your current window contains the text "NVIM"), it will show the tab NeoVim.

To determine the current focused Window name, Kebihelp uses a command that you'll have to define in the Parameters. The command you set up should return one single line with the information you want.

Example:

{
  "Parameters": {
    "cmd_focused_window": "hyprctl -j activewindow | jq '.class + \" - \" + .title'",
  }
}

Here, the current focused window name is determined with hyprctl (Hyprland CLI tool), and then the class and title of the window will be shown.

To launch Kebihelp with the automatic detection, add the -a or --auto option: kebihelp show -a

Hiding tabs, groups or keybindings

Instead of removing them entirely from your kebihelp.json, you can hide a tab, a group or a particular keybinding by setting up the _hidden key to true. Once set up, the tab, group or keybinding will not be shown anymore in the GUI.

Customizing the GUI

You can configure the visual aspect of the GUI helper:

  • Font name and size of any part
  • Colors

To do that, edit the kebihelp.json config file.

Size of the window

The Window layout has a fixed size. You can change it in the config file:

"layout" {
  "width": 900,
  "height": 900
}

These parameters are important: depending of the size of the Window and the number of keybindings, it will enable (or not) the scrollbars.

Remap default keys

By default, the following keys are configured:

Key Function
Tab Go to next tab
Shift+Tab Go to previous tab
Down Scroll down
Up Scroll up
Esc Quit

You can remap these keys in the config file.

To set-up VIM style keybindings, configure the section keys in the Parameters of the kebihelp.json config file:

"keys": {
  "tab_previous": "h", 
  "tab_next": "l",
  "scroll_down": "j",
  "scroll_up": "k",
  "quit": "q"
}

Feedbacks

This tool is not perfect, but it may be useful to build your own "keybinding helper" if your Desktop Environment does not support this feature. Your contributions are welcomed!

"Buy Me A Coffee"

Release files for kebihelp 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kebihelp 0.1.2
File Size Uploaded
kebihelp-0.1.2.tar.gz 13.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kebihelp 0.1.2
File Interpreter ABI Platform
kebihelp-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 24.8 kB

Release files / kebihelp-0.1.2.tar.gz

Download URL kebihelp-0.1.2.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0144534c9330b6f369f0b5e1dd2baa5964318dea963aeaeec21d24bfdbed22e0
BLAKE2b-256 checksum
How to use checksums
1a7208b81c56f0ddfc75e4d7b648762aa89447a4d1e01b147de321b70d6eabd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.3

Release files / kebihelp-0.1.2-py3-none-any.whl

Download URL kebihelp-0.1.2-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26ab2f51469e62610c5ec9b9b03261a4271868f73514ef81bd022dfeeb73ddc3
BLAKE2b-256 checksum
How to use checksums
9cd8183fcf1314141602ca91b5e5209e5f140a1952297bb1e6091c69dbcddbc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page