diff --git a/README.md b/README.md index ff0e780..bdf5057 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Some sane defaults for git, zsh (using oh-my-zsh), kitty, neovim and tmux. +Some sane defaults for git, zsh (using oh-my-zsh), kitty, Karabiner-Elements, neovim and tmux. Install needed packages: @@ -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`). +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`. ![user prompt](https://24unix.net/build/images/Settings/user_screen.png) [original image, 1.8M](https://24unix.net/build/images/Settings/user_screen_original.png) diff --git a/install.sh b/install.sh index 237663c..86a92cf 100755 --- a/install.sh +++ b/install.sh @@ -102,6 +102,9 @@ apply_dotfiles() { link_dotfile "$DOTFILES_DIR/kitty" "$HOME/.config/kitty" 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" + fi install_kitty_icon install_tmux_plugins install_powerlevel10k diff --git a/karabiner/assets/complex_modifications/kitty-hud.json b/karabiner/assets/complex_modifications/kitty-hud.json new file mode 100644 index 0000000..78a114a --- /dev/null +++ b/karabiner/assets/complex_modifications/kitty-hud.json @@ -0,0 +1,18 @@ +{ + "type": "basic", + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": ["control"], + "optional": [] + } + }, + "to": [ + { + "key_code": "vk_none" + }, + { + "shell_command": "/Applications/kitty.app/Contents/MacOS/kitten quick-access-terminal >/tmp/kitty-quick-access.log 2>&1 &" + } + ] +} diff --git a/karabiner/assets/complex_modifications/kitty-quick-access.json b/karabiner/assets/complex_modifications/kitty-quick-access.json new file mode 100644 index 0000000..e1fde42 --- /dev/null +++ b/karabiner/assets/complex_modifications/kitty-quick-access.json @@ -0,0 +1,25 @@ +{ + "title": "Kitty quick access terminal", + "rules": [ + { + "description": "Ctrl+Enter toggles kitty quick-access-terminal", + "manipulators": [ + { + "type": "basic", + "from": { + "key_code": "return_or_enter", + "modifiers": { + "mandatory": ["control"], + "optional": ["any"] + } + }, + "to": [ + { + "shell_command": "/Applications/kitty.app/Contents/MacOS/kitten quick-access-terminal --detach" + } + ] + } + ] + } + ] +} diff --git a/karabiner/karabiner.json b/karabiner/karabiner.json new file mode 100644 index 0000000..faba434 --- /dev/null +++ b/karabiner/karabiner.json @@ -0,0 +1,9 @@ +{ + "profiles": [ + { + "name": "Default profile", + "selected": true, + "virtual_hid_keyboard": { "keyboard_type_v2": "ansi" } + } + ] +}