A shell script to parse and display keybindings + descriptions, as well as optionally edit them.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ash 9fdd9b5277 add a help message, replace usage section in readme with help message 1 year ago
screenshots update README and screenshots 1 year ago
README.md add a help message, replace usage section in readme with help message 1 year ago
sxhkd-bindings add a help message, replace usage section in readme with help message 1 year ago

README.md

sxhkd-bindings

A shell script to parse and display keybindings + descriptions, as well as optionally edit them.

Requirements

  • grep
  • sed
  • rofi
  • sxhkdrc setup in the proper format (more info below)

sxhkdrc format

In order to parse properly, you need to place some stuff into your rc file.
You need to place a one line comment directly above a keybinding with this format: description: DESCRIPTION.

For example:

# description: transparent uxterm
alt + Return
    uxterm & sleep 0.25 && transset -a 0.8

Note: It shouldn't matter how you capitalize "description" as I have grep and sed set to use case insensitive searching.
However, it has not been tested, so I have no idea how well it works.

Screenshots

Example (from above) output:
example

And here is what a more full example would look like:
full example

You can also display descriptions without "description: " included:
full alternate example

Note: Your rofi will look different due to using a different theme.
If you like the one I'm using, you may find it here in my dotfiles repo.

Installation

  1. curl -sSL https://raw.githubusercontent.com/Phate6660/sxhkd-bindings/master/sxhkd-bindings -o sxkhkd-bindings
  2. Inspect the script. Don't run scripts from the internet without checking them.
  3. chmod +x sxhkd-keybindings
  4. Move the script to anywhere in your $PATH and run the command, or just run it as is.

Usage

$ sxhkd-bindings h


sxhkd-bindings 0.0.1
Phate6660 <https://github.com/Phate6660>

ARGs
----
d: Display descriptions without "description: "
e: Edit "$HOME/.config/sxhkd/sxhkdrc" with "$EDITOR"
h: Display this help message
Anything not the above args, or nothing at all: Display keybindings and descriptions like normal

Note: $HOME and $EDITOR actually expand, ain't that neato?
So for me, the e line actually looks like this:
e: Edit "/home/valley/.config/sxhkd/sxhkdrc" with "/usr/bin/emacs -nw"