Skip to content

licht1stein/gokuscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Gokuscript

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.

Implemented

resetvars.clj

automatically generate a rule to reset all variables to 0

Usage

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:

  1. find all variables by the regex pattern provided to the script
  2. 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.

Installation

  1. Install babashka
  2. 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

About

Scripts to automatically generate elements of karabiner.edn for Goku

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published