yqrashawn / GokuRakuJoudo

config karabiner with ease
GNU General Public License v3.0
1.19k stars 123 forks source link

Integrate json config with goku generated congid #66

Open fredcallaway opened 4 years ago

fredcallaway commented 4 years ago

Hi there! I have an existing configuration using the premade json-based configs that you can download from the karabiner website. I would like to keep these, and then add new configurations using goku. Is that possible? Otherwise I guess I have to translate all of my existing remappings into the goku edn format?

yqrashawn commented 4 years ago

Otherwise I guess I have to translate all of my existing remappings into the goku edn format

Yes. Goku doesn't support combine both formats. But you can simply convert json config to edn use online edn->json converter and put those rules in goku's :rules section like here.

I don't think goku will support this since goku's goal is to replace json config with edn.

fredcallaway commented 4 years ago

OK, I tried this using this converter. I get Exception in thread "main" java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap

Here is the minimal example:

{:main [
 {:des "Test"
  :rules [
   {:from
    {:key_code "u",
     :modifiers
     {:mandatory
      ["left_control" "left_option"],
      :optional ["any"]}},
    :to [{:key_code "left_arrow"}],
    :type "basic"}
   {:from
    {:key_code "k",
     :modifiers
     {:mandatory
      ["left_control" "left_option"],
      :optional ["any"]}},
    :to [{:key_code "down_arrow"}],
    :type "basic"}
    ]
  }
]}
fredcallaway commented 4 years ago

I don't expect you to debug this for me, and I've gotten used to the json format anyway. However, I do think it would be a very nice feature if goku could "import" a json config, converting it into the goku edn format.

yqrashawn commented 4 years ago

you need to convert all "*" to :*

sidharthv96 commented 3 years ago

An inbuilt converter would be extremely useful. I currently have a 4k line json file which was generated with my custom ruby configs and colemak bindings.

Goku taking in existing and converting to edn would definitely reduce the barrier of entry.

edit after using goku.

WOAH!! I was able to fit a lot more functionality into ~70 lines, including the colemak bindings. Blown away by the power! Kudos @yqrashawn 🤩