Manage Karabiner config from dotfiles
This commit is contained in:
@@ -14,7 +14,7 @@ From your users home directory (~/), execute:
|
||||
To install oh-my-zsh and symlink the config files run:
|
||||
```sh .config/dotfiles/install.sh```
|
||||
|
||||
This replaces the managed dotfiles in your home directory (`.zshrc`, `.zprofile`, `.gitconfig`, `.p10k.zsh`, `~/.config/kitty`, `~/.config/nvim`, and `~/.config/tmux`). On macOS it also links `~/.config/karabiner`.
|
||||
This replaces the managed dotfiles in your home directory (`.zshrc`, `.zprofile`, `.gitconfig`, `.p10k.zsh`, `~/.config/kitty`, `~/.config/nvim`, and `~/.config/tmux`). On macOS it also links `~/.config/karabiner/karabiner.json` and `~/.config/karabiner/assets`, while leaving Karabiner's local backup files unmanaged.
|
||||
|
||||

|
||||
[original image, 1.8M](https://24unix.net/build/images/Settings/user_screen_original.png)
|
||||
|
||||
@@ -103,7 +103,7 @@ apply_dotfiles() {
|
||||
link_dotfile "$DOTFILES_DIR/nvim" "$HOME/.config/nvim"
|
||||
link_dotfile "$DOTFILES_DIR/tmux" "$HOME/.config/tmux"
|
||||
if [ "$(uname -s)" = "Darwin" ]; then
|
||||
link_dotfile "$DOTFILES_DIR/karabiner" "$HOME/.config/karabiner"
|
||||
install_karabiner_config
|
||||
fi
|
||||
install_kitty_icon
|
||||
install_tmux_plugins
|
||||
@@ -152,6 +152,12 @@ link_dotfile() {
|
||||
echo "${GREEN}Linked $target_path -> $source_path${RESET}"
|
||||
}
|
||||
|
||||
install_karabiner_config() {
|
||||
mkdir -p "$HOME/.config/karabiner"
|
||||
link_dotfile "$DOTFILES_DIR/karabiner/karabiner.json" "$HOME/.config/karabiner/karabiner.json"
|
||||
link_dotfile "$DOTFILES_DIR/karabiner/assets" "$HOME/.config/karabiner/assets"
|
||||
}
|
||||
|
||||
install_kitty_icon() {
|
||||
icon_path="$DOTFILES_DIR/kitty/kitty.app.png"
|
||||
|
||||
|
||||
@@ -1,9 +1,75 @@
|
||||
{
|
||||
"profiles": [
|
||||
{
|
||||
"complex_modifications": {
|
||||
"rules": [
|
||||
{
|
||||
"description": "kitty: map cmd+left/right to ctrl+left/right",
|
||||
"manipulators": [
|
||||
{
|
||||
"conditions": [
|
||||
{
|
||||
"bundle_identifiers": [
|
||||
"^net\\.kovidgoyal\\.kitty$"
|
||||
],
|
||||
"type": "frontmost_application_if"
|
||||
}
|
||||
],
|
||||
"from": {
|
||||
"key_code": "left_arrow",
|
||||
"modifiers": {
|
||||
"mandatory": ["command"],
|
||||
"optional": ["any"]
|
||||
}
|
||||
},
|
||||
"to": [
|
||||
{
|
||||
"key_code": "left_arrow",
|
||||
"modifiers": ["control"]
|
||||
}
|
||||
],
|
||||
"type": "basic"
|
||||
},
|
||||
{
|
||||
"conditions": [
|
||||
{
|
||||
"bundle_identifiers": [
|
||||
"^net\\.kovidgoyal\\.kitty$"
|
||||
],
|
||||
"type": "frontmost_application_if"
|
||||
}
|
||||
],
|
||||
"from": {
|
||||
"key_code": "right_arrow",
|
||||
"modifiers": {
|
||||
"mandatory": ["command"],
|
||||
"optional": ["any"]
|
||||
}
|
||||
},
|
||||
"to": [
|
||||
{
|
||||
"key_code": "right_arrow",
|
||||
"modifiers": ["control"]
|
||||
}
|
||||
],
|
||||
"type": "basic"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"fn_function_keys": [
|
||||
{
|
||||
"from": { "key_code": "f6" },
|
||||
"to": [{ "key_code": "f6" }]
|
||||
}
|
||||
],
|
||||
"name": "Default profile",
|
||||
"selected": true,
|
||||
"virtual_hid_keyboard": { "keyboard_type_v2": "ansi" }
|
||||
"virtual_hid_keyboard": {
|
||||
"country_code": 0,
|
||||
"keyboard_type_v2": "ansi"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user