Scripts to automatically edit karabiner.edn
for Goku.
Goku is a tool that lets you manage your Karabiner configuration with ease.
Gokuscript are tools that operate on your karabiner.edn
to automate complex and boring tasks.
automatically generate a rule to reset all variables to 0
Add a following rule somewhere in your karabiner.edn
:
{:des "Reset all variables"
:rules [[:!0 []]]}
You may change the :!0
to whatever key you like.
Once the script executes, it will:
- find all variables by the regex pattern provided to the script
- find the target rule by it’s
:des
and replace the empty[]
with the generated action, something like:
[["layer_14c_onepress" 0] ["layer_15c_onepress" 0] ...]
for all the variables found in step 1.
- Install babashka
- Run
bb SCRIPT -h
for help.
For example:
bb resetvars.clj -h
━━━━━━━━┏┓━━━━━━━━━━━━━━━━━━━━━━━━┏┓━
━━━━━━━━┃┃━━━━━━━━━━━━━━━━━━━━━━━┏┛┗┓
┏━━┓┏━━┓┃┃┏┓┏┓┏┓┏━━┓┏━━┓┏━┓┏┓┏━━┓┗┓┏┛
┃┏┓┃┃┏┓┃┃┗┛┛┃┃┃┃┃━━┫┃┏━┛┃┏┛┣┫┃┏┓┃━┃┃━
┃┗┛┃┃┗┛┃┃┏┓┓┃┗┛┃┣━━┃┃┗━┓┃┃━┃┃┃┗┛┃━┃┗┓
┗━┓┃┗━━┛┗┛┗┛┗━━┛┗━━┛┗━━┛┗┛━┗┛┃┏━┛━┗━┛
┏━┛┃━━━━━━━━━━━━━━━━━━━━━━━━━┃┃━━━━━━
┗━━┛━━━━━━━━━━━━━━━━━━━━━━━━━┗┛━━━━━━
Gokuscript to automatically generate a command to reset all variables to 0.
Usage: bb gokuscripts.clj FILE [options]
Options:
-d, --des DESCRIPTION Reset all variables :des field to find the right rule to edit
-p, --pattern PATTERN layer_[\w\d_]* Regex pattern to find all variables by
-t, --target-file FILE Target file to write to. If not provided write to original file.
-h, --help