yqrashawn / GokuRakuJoudo

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

how to set custom variable when open a file type? #79

Closed bangedorrunt closed 4 years ago

bangedorrunt commented 4 years ago

@yqrashawn, in the example section same key in different mode, you say that we can set custom variable when open a file type using karabiner cli, but i'm wondering how we can do that? could you elaborate?

yqrashawn commented 4 years ago

Seems the link is broken in the doc. I never tried it on my own. But karabiner's cli has the arg --set-variables which can

Set variables which are used in complex modifications.

So I suppose user can, for example, set the editing_file_cpp variable by invoking some editor functionality to execute shell script when opening a .cpp file. Combine with a current application condition user can define rules for editing cpp file in each application.

bangedorrunt commented 4 years ago

So I suppose user can, for example, set the editing_file_cpp variable by invoking some editor functionality to execute shell script when opening a .cpp file

thank you, that's what i thought. i think whenever a project is opened, we can run a simple task that execute karabiner_cli to set the variable.