Skip to main content

Cheat-sheets for shortcuts & commands at your fingertips.

Project description

KeyHint

Display keyboard shortcuts or other hints based on the the active window. (GTK, Linux only!)


Tests passing License: MIT Code style: black Coverage Status


Dependencies

Make sure to install the following dependencies:

sudo apt install pkg-config python3-dev libcairo2-dev libgirepository1.0-dev

Usage

  • Install from PyPi with pip install keyhint and run keyhint.
  • Or download the Binary from releases, make it executable and run it.
  • Configure a global hotkey (e.g. F1) to start KeyHint on demand.

KeyHint with KeyBindings for VS Code:

VS Code Shortcuts

CLI Options

Application Options:
  -h, --hint=HINT-ID                      Show hints by specified ID
  -d, --default-hint=HINT-ID              Hint to show in case no hints for active application were found
  -a, --accent-color=css color string     Accent color, used e.g. for section titles
  -v, --verbose                           Verbose log output for debugging
  --display=DISPLAY                       X display to use

Configuration

  • The config directory is ~/.config/keyhint/.
  • To customize existing hints, copy the corresponding .yaml-file into the config directory. Make your changes in a text editor. As long as you don't change the id it will overwrite the defaults.
  • To create new hints, I suggest you also start with one of the existing .yaml-file:
    • Place it in the config directory and give it a good file name.
    • Change the value id to something unique.
    • Adjust regex_process and regex_title so it will be selected based on the active window. (See Tips)
    • Add the hints to be displayed.
    • If you think the hints might be useful for others, please consider opening a pull request or an issue.
  • You can always reset a configuration to the shipped version by deleting the .yaml files from the config folder.

Tips

Hints selection:

  • The hints to be displayed on startup are selected by comparing the value of regex_process with the wm_class of the active window and the value of regex_title with the title of the active window.
  • The potential hints are processed alphabetically by filename, the first file that matches both wm_class and title are gettin displayed.
  • Both of regex_ values are interpreted as case insensitive regular expressions.
  • Check "Debug Info" in the application menu to get insights about the active window and the selected hints file.

Available hints:

  • Check the included yaml-files to see wich applications are available by default.
  • Feel free submit additional yaml-files for further applications.

Differentiate hints per website:

  • For showing different browser-hints depending on the current website, you might want to use a browser extension like "Add URL To Window Title" and then configure the sections in hints.yaml to look for the URL in the window title.

Contribute

I'm happy about any contribution! Especially I would appreciate submissions to improve the shipped hints. (The current set are the hints I personally use).

Design Principles

  • Don't run as service
    It shouldn't consume resources in the background, even if this leads to slower start-up time.
  • No network connection
    Everything should run locally without any network communication.
  • Dependencies
    The fewer dependencies, the better.
  • Multi-Monitors
    Supports setups with two or more displays

Certification

WOMM

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keyhint-0.2.4.tar.gz (647.1 kB view details)

Uploaded Source

Built Distribution

keyhint-0.2.4-py3-none-any.whl (646.8 kB view details)

Uploaded Python 3

File details

Details for the file keyhint-0.2.4.tar.gz.

File metadata

  • Download URL: keyhint-0.2.4.tar.gz
  • Upload date:
  • Size: 647.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.10 Linux/5.11.0-1028-azure

File hashes

Hashes for keyhint-0.2.4.tar.gz
Algorithm Hash digest
SHA256 8619d4cf079ff7714d9d259f719470acffc15f5ebc6c41409cda8098f4d290ff
MD5 0c1b6fc854b08ae0fd24a8e61a715569
BLAKE2b-256 3e90cf54519cae743fa5fbf8761d5af7a48802eb22b3aff2e8e3bd6f8f3d7dee

See more details on using hashes here.

File details

Details for the file keyhint-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: keyhint-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 646.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.10 Linux/5.11.0-1028-azure

File hashes

Hashes for keyhint-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c4915b6fb5b80a671bb121f07a4c3f0c4e09694785ebaee57106bf2ebbe49223
MD5 64a42a43b15bb50622ef50247c6e064c
BLAKE2b-256 e032bb61e6e15a071eceb5a06f34902428c38fe928058e6b11f1c5a21b13ae9b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page