yqrashawn / GokuRakuJoudo

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

Question about (multiple) conditions #161

Closed farzadmf closed 2 years ago

farzadmf commented 2 years ago

Hi, I'm following the tutorial, but using multiple conditions doesn't seem to work for me:

So, I start with this one:

{:applications {:chrome ["^com\\.google\\.Chrome$"]}
 :main [{:des "a to 1 chrome" :rules [[:a :1 :chrome]]}]}

and this, as expected, changes a to 1 only in Chrome

But then I change it to this:

{:applications {:chrome ["^com\\.google\\.Chrome$"]
                :safari ["^com\\.apple\\.Safari$"]}
  :main [{:des "a to 1 only in chrome, safari" :rules [[:a :1 [:chrome :safari]]]}]}

and a keeps being a no matter what window I'm in.

Can you please tell me what I'm missing here?

lukakemperle commented 2 years ago

+1

Dimentium commented 2 years ago

you can try to use the aggregated application rule:

{
:applications {
               :browsers ["^com\\.google\\.Chrome$"
                          "^com\\.apple\\.Safari$"]
               }
:main [
       {:des "a to 1 only in chrome, safari" 
        :rules [
                [:a :1 :browsers]
               ]
       }
      ]
}
yqrashawn commented 2 years ago

[:chrome :safari] means “when application is chrome AND safari”. Please try @Dimentium's snippet.

farzadmf commented 2 years ago

Hey @yqrashawn , sorry for the late reply.

Unfortunately, I didn't get a chance to try this, but what I included in the issue is I think a copy paste of the tutorial, where it's using [:chrome :safari]

So, does that mean the tutorial is wrong?

Also, would it be possible to have a list of supported "keywords"? For example, Karabiner's JSON has description, but this tool seems to use des for that