Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating karabiner.json from scratch? #243

Open
toxxmeister opened this issue Apr 29, 2024 · 0 comments
Open

Generating karabiner.json from scratch? #243

toxxmeister opened this issue Apr 29, 2024 · 0 comments

Comments

@toxxmeister
Copy link

Hi! Do you have any plans on making Goku able to generate karabiner.json from scratch in the future?

I understand that some users use Karabiner in more complex ways that require a lot of setup in karabiner.json that is not already covered by Goku, but in my particular case, the only things I am missing are global options. In fact, up until recently, my karabiner-template.json looked like this:

{
  "global": {
    "check_for_updates_on_startup": false,
    "show_in_menu_bar": false
  },
  "profiles": [{"name": "Default"}]
}

with everything else coming from karabiner.edn. I had a simple script that'd replace karabiner.json with
karabiner-template.json and then run goku.

It could be that I am pushing this too far, as my use case might be a bit particular, given that I don't have any complex device setups, heck I don't even define fn keys functionality there, but as regular complex modifications. Still might be worth discussing whether Goku could in the future be "standalone".


As a reference to anyone in a similar situation, I currently have global settings embedded into karabiner.edn and use jet to parse them and profiles to create karabiner.json on the fly without using any explicit template, before running goku:

# update-karabiner.sh
cat "$XDG_CONFIG_HOME/karabiner/karabiner.edn" | jet --to json --func \
  '#(assoc (select-keys % [:global])
           :profiles (map (fn [[k _]] {:name k}) (:profiles %)))'     \
  > "$XDG_CONFIG_HOME/karabiner/karabiner.json"

goku
;; karabiner.edn
{:global {:check_for_updates_on_startup false :show_in_menu_bar false}
 :profiles {:Default {:default true :sim 50 :delay 500 :alone 1000 :held 1000}}
 ;; ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant