skhd icon indicating copy to clipboard operation
skhd copied to clipboard

Implementing an Uberischt widget for displaying inline docstrings in skhdrc files

Open strazto opened this issue 5 years ago • 6 comments

Hi, I'm planning on writing a simple widget that parses inline docstrings (Probably regular comments with a leading character to indicate its a docstring, like #' or something).

I was wondering if, once done, you'd be open to linking to it from the readme? Also, I was wondering if you had suggestions for the syntax, I was thinking something like:

#' ${cmd} + alt - 1 : Go to workspace 1
#' ${cmd} + alt - n : Go to workspace n

https://github.com/koekeishiya/skhd/blob/01722fcf49a5826392010504162bc63e2b01c423/examples/skhdrc#L170-L179

Displaying as:

⌘ + alt - 1 : Go to workspace 1 ⌘ + alt - n : Go to workspace n

Or something, where cmd is escaped one way or another and automatically parsed to ⌘

& perhaps following markdown syntax in all other regards.

strazto avatar Feb 11 '20 02:02 strazto

Is the intention for this to be some kind of "cheat-sheet" to quickly look up configured binds and what they do?

koekeishiya avatar Feb 12 '20 10:02 koekeishiya

Is the intention for this to be some kind of "cheat-sheet" to quickly look up configured binds and what they do?

More or less

strazto avatar Feb 12 '20 10:02 strazto

looking to do the same thing.

I borrowed the format from Regolith's Remontoire and built an initial skhdrc for Yabai(still a WIP).

Haven't looked at writing the Uberischt widget yet.

deekue avatar Jun 14 '20 05:06 deekue

looking to do the same thing.

I borrowed the format from Regolith's Remontoire and built an initial skhdrc for Yabai(still a WIP).

Haven't looked at writing the Uberischt widget yet.

Yeah, regoliths implementation is great- looking forward to seeing what you do!

strazto avatar Jun 14 '20 06:06 strazto

first pass is clunky but it works.

it'd be better to get the current config from skhd itself (eg. Remontoire makes an IPC to i3). It would also cover the case of any .load statements

something like
skhd --dump_config

deekue avatar Jun 15 '20 18:06 deekue

I changed tack and refactored skhd_parse.py to output HTML directly or a base64 encoded data: URI, which can be passed to Google Chrome.

# ## Launch // This Dialog // <fn><shift> ? ##
fn + shift - 0x2C : open -na "Google Chrome" --args --new-window --app="$(skhd_parse.py -f data)"

deekue avatar Jul 07 '20 03:07 deekue