/query-skhd

A shell script to parse and output the skhd config as JSON.

Primary LanguageJavaScriptMIT LicenseMIT

query-skhd

A shell script to parse and output your skhd config as JSON.

Features

Parses your skhd config as described here.

  • Automatically finds the location of the skhd config file.
  • Parses the .load directive recursively (up to a depth of 10).
  • Parses mode definitions.
  • Parses shortcuts.
  • Parses shortcuts that are part of a mode.
  • Shows -> and @ when used.
  • Can return the data as JSON to be used with jq or other JSON parsing utilities.
  • Can return the data in an easy to read format.
  • Shows comments instead of the script when there is a comment.
  • Does not support querying the .blacklist directive yet.
  • Does not support application specific hotkeys yet.

Installation

Download the query_skhd file by cloning this repository:

git clone https://github.com/es183923/query-skhd.git

or by directly downloading the query_skhd file itself here.

Usage

  1. Add the execute permission to the file.
chmod +x query_skhd
  1. Add the file to your PATH.
  2. Run query_skhd by typing query_skhd

Arguments

Depth

Sets the depth for recursively parsing the config file.

examples:

query_skhd -d 3
query_skhd -d=3
query_skhd --depth 3
query_skhd --depth=3

Pretty Print

Prints the config in an easy to read format.

example:

query_skhd -p

Force Script

Forces the script to show instead of the comment.

example:

query_skhd -s

Credits

This project was created as a utility for skhd.