pqrs-org / Karabiner-archived

Karabiner (KeyRemap4MacBook) is a powerful utility for keyboard customization.
https://pqrs.org/osx/karabiner/
The Unlicense
3.82k stars 309 forks source link

separate preferences file #9

Closed franciscolourenco closed 10 years ago

franciscolourenco commented 13 years ago

It would be really cool to have an external configuration file with a list of all the checked options.

Purpose:

tekezo commented 13 years ago

About sync setting, didn't it put the plist file in Dropbox and symlink it? ~/Library/Preferences/org.pqrs.KeyRemap4MacBook.plist

About sharing, how about KeyRemap4MacBook_cli? Though the UI is unkind, "changed" and "enable" options are useful. (Known issue: enable options cannot control variables in number.xml such as repeat.wait.)

$ /Library/org.pqrs/KeyRemap4MacBook/app/KeyRemap4MacBook_cli.app/Contents/MacOS/KeyRemap4MacBook_cli changed $ /Library/org.pqrs/KeyRemap4MacBook/app/KeyRemap4MacBook_cli.app/Contents/MacOS/KeyRemap4MacBook_cli enable XXX

It's an example of KeyRemap4MacBook_cli: https://github.com/keqh/_config/blob/master/mac/keyremap4macbook.sh

tekezo commented 13 years ago

About sync setting, didn't it put the plist file in Dropbox and symlink it?

Excuse me. This approach will not work because the symlink is unlinked and new regular plist file is created when we changed the configuration.

franciscolourenco commented 13 years ago

yup.. the configurations file has to be inside a symlinked folder.. for example on ~/Library/Application Support/Keyremap4macbook

In alternative there has to be an option, (like there is on 1Password, TextExpander, etc..) to save and keep the preferences in sync using dropbox. Or just a way of defining the location of the preferences file.

It has also to be version tolerant. It has to be able to simply ignore settings which are not recognized..

tekezo commented 13 years ago

Oh! TextExpander is a great!

It is possible to do if we don't use NSUserDefaults (implement this function by ourself). I'll change to put the setting file at ~/Library/Application Supprt/KeyRemap4MacBook/configuration.xml. Then we can synchronize a file by the symlink approach. I would like to do at version 7.4.0 or later.

Note for me: We must reload the setting file automatically when Dropbox updated it. Unless reloading, a slave machine override the setting by previous version.

lynaghk commented 11 years ago

What's the status on this? I tried digging around but the latest version (8.0.0) doesn't put anything in ~/Library/Application Supprt/KeyRemap4MacBook/ besides private.xml.

tekezo commented 11 years ago

This issue has not yet been implemented.

P.S. I added "export" function to command line interface. For now, you can dump settings into shell script by export function. Then, you can share config by executing this script on another machine. https://pqrs.org/osx/karabiner/document.html.en#commandlineinterface

lynaghk commented 11 years ago

Oh, I'd prefer a command line interface anyway---thanks = )

If you ever make it out to Portland, OR USA find me so I can get you a beer or coffee.

eladmoshe commented 9 years ago

For others who might be interested, the url by @tekezo is broken, but this one works: https://pqrs.org/osx/karabiner/document.html.en#commandlineinterface (see "About export option" section).

Backup:

$ /Applications/Karabiner.app/Contents/Library/bin/karabiner export > ~/Desktop/karabiner-import.sh

Restore:

sh ~/Desktop/karabiner-import.sh
tekezo commented 9 years ago

Thanks! I've fixed the url.

dvcrn commented 8 years ago

Any updates on this? I am also looking for a way to specify either the folder of the plist file or symlink it into my dropbox

tekezo commented 8 years ago

There is no progress. (And I'm working on Sierra support, so I cannot take a time for this issue for a while.)

asmeurer commented 8 years ago

For those who want to sync Karabiner preferences with git (it should also work with Dropbox), I wrote a tool that can help: https://github.com/asmeurer/prefsync. I personally use it to sync my Karabiner prefs. For many things that I've tried it with it's a bit annoying to track their preferences in git because they are constantly writing things like timestamps to the pref file, but for Karabiner it works quite nicely (the pref file generally updates only when a pref is changed, or sometimes when Karabiner is updated). To use it run

prefsync ~/Library/Preferences/org.pqrs.Karabiner.plist /path/to/synced/org.pqrs.Karabiner.plist
franciscolourenco commented 8 years ago

Just to confirm, has anyone been able to use Mackup to sync the selected checkboxes?

franciscolourenco commented 8 years ago

https://github.com/lra/mackup/issues/857

franciscolourenco commented 8 years ago

I'm using mackup to sync preferences via Dropbox. The problem is that Karabiner is updating ~/Library/Preferences/org.pqrs.Karabiner.plist as it is being used and causing dropbox to work all the time. Why is Karabiner saving the state to the preferences file instead of keeping it only in memory?