Giter Club home page Giter Club logo

gokuscript's Introduction

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

gokuscript's People

Contributors

licht1stein avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.