yqrashawn / GokuRakuJoudo

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

JSONParse Exception #170

Open karanrajpal14 opened 2 years ago

karanrajpal14 commented 2 years ago

Hello,

I'm unable to get this to work on my MBP running Big Sur. Despite providing a working config which I picked up from one of your examples from the tutorial here

I see this error when I run the program against my config:

❯ goku -c ~/.config/karabiner/karabiner.edn
Exception in thread "main" com.fasterxml.jackson.core.JsonParseException: Unexpected character ('{' (code 123)): was expecting double-quote to start field name
 at [Source: (PushbackReader); line: 15, column: 8]
    at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1840)
    at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:712)
    at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:637)
    at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddName(ReaderBasedJsonParser.java:1782)
    at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:708)
    at cheshire.parse$parse_STAR_.invokeStatic(parse.clj:65)
    at cheshire.parse$parse_STAR_.invoke(parse.clj:63)
    at cheshire.parse$parse_STAR_.invokeStatic(parse.clj:65)
    at cheshire.parse$parse_STAR_.invoke(parse.clj:63)
    at cheshire.parse$parse_STAR_.invokeStatic(parse.clj:66)
    at cheshire.parse$parse_STAR_.invoke(parse.clj:63)
    at cheshire.parse$parse_STAR_.invokeStatic(parse.clj:65)
    at cheshire.parse$parse_STAR_.invoke(parse.clj:63)
    at cheshire.parse$parse.invokeStatic(parse.clj:100)
    at cheshire.parse$parse.invoke(parse.clj:88)
    at cheshire.core$parse_stream.invokeStatic(core.clj:252)
    at cheshire.core$parse_stream.invoke(core.clj:234)
    at cheshire.core$parse_stream.invokeStatic(core.clj:249)
    at cheshire.core$parse_stream.invoke(core.clj:234)
    at karabiner_configurator.misc$load_json.invokeStatic(misc.clj:60)
    at karabiner_configurator.misc$load_json.invoke(misc.clj:56)
    at karabiner_configurator.core$update_to_karabiner_json.invokeStatic(core.clj:99)
    at karabiner_configurator.core$update_to_karabiner_json.doInvoke(core.clj:95)
    at clojure.lang.RestFn.invoke(RestFn.java:439)
    at karabiner_configurator.core$parse.invokeStatic(core.clj:150)
    at karabiner_configurator.core$parse.doInvoke(core.clj:142)
    at clojure.lang.RestFn.invoke(RestFn.java:439)
    at karabiner_configurator.core$_main.invokeStatic(core.clj:239)
    at karabiner_configurator.core$_main.doInvoke(core.clj:234)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at karabiner_configurator.core.main(Unknown Source)
^C

And this is what my karabiner.edn file looks like:

;; main contains multiple manipulators
;; each manipulator has a description and multiple rules

;; main                -> {:main [{:des "..." :rules [rule1 rule2 ...]}]}
;; manipulator         -> {:des "..." :rules [rule1 rule2 ...]}
;; manipulator's rules -> [rule1 rule2 ...]
{:main [{:des "a to 1, b to 2, c to insert 1 2 3"
         :rules [[:a :1] [:b :2] [:c [:1 :2 :3]]]}]}

;; or we can separate them into three manipulators
{:main [{:des "a to 1" :rules [[:a :1]]}
        {:des "b to 2" :rules [[:b :2]]}
        {:des "c to insert 123" :rules [[:c [:1 :2 :3]]]}]}

;; in rules [:a :1] -- [<from> <to>]
;; it means from key a to key 1
;; these keycode is just original karabiner keycode prefix with colon

I'm unsure about what I'm doing wrong here. Would you please help me out? Thank you!

nikitajz commented 9 months ago

Just started looking into Goku and came across a similar issue even on simple examples.

It might be an actual bug in the app. I've noticed that tests actually don't fail in CI, despite having failures https://github.com/yqrashawn/GokuRakuJoudo/actions/runs/5920932689/job/16052838243

tests screenshots ![image](https://github.com/yqrashawn/GokuRakuJoudo/assets/12535180/84ed70d6-a4d7-45f7-9ce7-91855afa8cfe) ![image](https://github.com/yqrashawn/GokuRakuJoudo/assets/12535180/77da61af-a344-440d-a15a-52df1f5a1708)

@yqrashawn not sure if you still maintain it, but would be great if you could take a look at it (along with fixing the version mismatch https://github.com/yqrashawn/GokuRakuJoudo/issues/194). Thanks in advance