Skip to main content

hag

A Hotkey AGgregator.

hag is a hotkey aggregator, it tries its best to extract the hotkeys of your software and display them.

It does so by parsing the config files, man pages, command outputs, ... depending on the software.

⌨️ Hotkey parsers

Bellow is a list of implemented hotkey parsers:

  • Alacritty
  • Bash
  • Gimp
  • Inkscape
  • Lf
  • Mpv
  • Neovim
  • Qutebrowser
  • Rofi
  • Sioyek
  • Sxhkd
  • Sxiv
  • Termite
  • Vim
  • Vimiv
  • Zathura
  • Zsh

📦 Installation

hag is meant to be minimal, however some parsers require optional dependencies, which can be individually installed:

  • Mpv: python-mpv -> pip install 'hag[mpv]'
  • Neovim: pynvim -> pip install 'hag[neovim]'
  • Alacritty: pyyaml -> pip install 'hag[alacritty]'

To install hag with all the parser dependencies:

pip install 'hag[all]'

If you just want to use the CLI interface, consider using pipx.

pipx install 'hag[all]'

📖 Usage

$ hag -h
usage: hag [-h] [-lp | -ld] [-d {json,roff,text}] [-m MODE] [-v]
           [{alacritty,bash,gimp,inkscape,lf,mpv,neovim,qutebrowser,rofi,sioyek,sxhkd,sxiv,termite,vim,vimiv,zathura,zsh}]

Hotkey aggregator. All your hotkeys in one place.

positional arguments:
  {alacritty,bash,gimp,inkscape,lf,mpv,neovim,qutebrowser,rofi,sioyek,sxhkd,sxiv,termite,vim,vimiv,zathura,zsh}
                        Extract hotkeys using parser.

optional arguments:
  -h, --help            show this help message and exit
  -lp, --list-parsers   List available hotkey parsers.
  -ld, --list-displays  List available display methods.
  -d {json,roff,text}, --display {json,roff,text}
                        Display method.
  -m MODE, --modes MODE
                        Filter by mode, if supported by parser.
  -v, --version         Show hag version and exit.

🔎 Examples

A few example uses:

  • List sxhkd hotkeys:
    hag sxhkd
    
  • Display sxhkd hotkeys in json format and format with jq:
    hag sxhkd -d json | jq
    
  • Show vim Normal and Visual mode hotkeys in rofi:
    hag vim -m Normal -m Visual | rofi -dmenu
    
  • Use rofi to select hotkey parser and show hotkeys:
    parser="$(hag -le | rofi -dmenu)" && hag "$parser" | rofi -dmenu
    
  • List your normal and visual mode neovim hotkeys in a man page:
    hag neovim -m Normal -m Visual -d roff | man -l -
    
  • Create a pdf of your sxhkd hotkeys:
    hag sxhkd -d roff | groff -T ps -m mandoc - | ps2pdf - hotkeys.pdf
    

🥳 Contributing

If you want to add support for your favourite software, feel free to open issues/PRs!

Metadata

Release files for hag 0.4.0

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

Source distribution (sdist)

Source distribution for hag 0.4.0
File Size Uploaded
hag-0.4.0.tar.gz 13.5 kB Details

Built distribution (wheel)

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

Total release size: 36.9 kB

Release files / hag-0.4.0.tar.gz

Download URL hag-0.4.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d6c22ef9fe80d5b0263d4dd1722cfad85ee84b570420161de96fbf4eacad78ce
BLAKE2b-256 checksum
How to use checksums
d7d64170c8e0e8cc314c5ca4b14f007e24becec23d69628c42e1278af3ac513b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.9 Linux/6.1.12-arch1-1

Release files / hag-0.4.0-py3-none-any.whl

Download URL hag-0.4.0-py3-none-any.whl
Size 23.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9fe776d5fee64893ccfe1d715e15323e98f3ae5cf81c6b90231ff4672ef59665
BLAKE2b-256 checksum
How to use checksums
9c5237ae658529b316f3bfb328d2b3fa78b79c37afb9e9b8546dcdc80640db0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.10.9 Linux/6.1.12-arch1-1

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

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