Skip to content

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

Notifications You must be signed in to change notification settings

Phate6660/sxhkd-bindings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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"

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages