koekeishiya / skhd

Simple hotkey daemon for macOS
MIT License
6.06k stars 204 forks source link

Implementing an Uberischt widget for displaying inline docstrings in skhdrc files #110

Open strazto opened 4 years ago

strazto commented 4 years ago

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.

koekeishiya commented 4 years ago

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

strazto commented 4 years ago

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

deekue commented 4 years ago

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.

strazto commented 4 years ago

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!

deekue commented 4 years ago

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 commented 4 years ago

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)"