From f815cdce66cec8b6caef5c10fd7d9210b2217f6d Mon Sep 17 00:00:00 2001 From: js0ny Date: Wed, 20 Nov 2024 14:49:35 +0000 Subject: [PATCH] feat (glow): Add glow.yaml --- .config/glow/glow.yaml | 8 ++ mac/karabiner/karabiner.json | 215 +++++++++++++++++++++++++++++++++++ mac/karabiner/readme.md | 4 + setup/mac_setup.sh | 13 ++- zsh/update.sh | 5 + 5 files changed, 241 insertions(+), 4 deletions(-) create mode 100644 .config/glow/glow.yaml create mode 100644 mac/karabiner/karabiner.json create mode 100644 mac/karabiner/readme.md diff --git a/.config/glow/glow.yaml b/.config/glow/glow.yaml new file mode 100644 index 0000000..ce719f3 --- /dev/null +++ b/.config/glow/glow.yaml @@ -0,0 +1,8 @@ +# style name or JSON path (default "auto") +style: "auto" +# mouse support (TUI-mode only) +mouse: true +# use pager to display markdown +pager: true +# word-wrap at width +width: 80 diff --git a/mac/karabiner/karabiner.json b/mac/karabiner/karabiner.json new file mode 100644 index 0000000..d22eb3c --- /dev/null +++ b/mac/karabiner/karabiner.json @@ -0,0 +1,215 @@ +{ + "profiles": [ + { + "complex_modifications": { + "rules": [ + { + "description": "Caps Lock to Esc and Ctrl", + "manipulators": [ + { + "from": { + "key_code": "caps_lock", + "modifiers": { "optional": ["any"] } + }, + "to": [{ "key_code": "left_control" }], + "to_if_alone": [{ "key_code": "escape" }], + "type": "basic" + } + ] + }, + { + "description": "Change left_control+hnei to arrow keys", + "manipulators": [ + { + "from": { + "key_code": "h", + "modifiers": { + "mandatory": ["left_control"], + "optional": ["any"] + } + }, + "to": [{ "key_code": "left_arrow" }], + "type": "basic" + }, + { + "from": { + "key_code": "n", + "modifiers": { + "mandatory": ["left_control"], + "optional": ["any"] + } + }, + "to": [{ "key_code": "down_arrow" }], + "type": "basic" + }, + { + "from": { + "key_code": "e", + "modifiers": { + "mandatory": ["left_control"], + "optional": ["any"] + } + }, + "to": [{ "key_code": "up_arrow" }], + "type": "basic" + }, + { + "from": { + "key_code": "i", + "modifiers": { + "mandatory": ["left_control"], + "optional": ["any"] + } + }, + "to": [{ "key_code": "right_arrow" }], + "type": "basic" + } + ] + } + ] + }, + "devices": [ + { + "identifiers": { + "is_keyboard": true, + "is_pointing_device": true, + "product_id": 626, + "vendor_id": 5426 + }, + "ignore": false, + "mouse_flip_y": true, + "simple_modifications": [ + { + "from": { "key_code": "left_command" }, + "to": [{ "key_code": "right_control" }] + }, + { + "from": { "key_code": "left_control" }, + "to": [{ "key_code": "left_command" }] + } + ] + }, + { + "identifiers": { + "is_pointing_device": true, + "product_id": 45088, + "vendor_id": 1133 + }, + "ignore": false, + "mouse_flip_vertical_wheel": true + } + ], + "name": "Default profile", + "selected": true, + "simple_modifications": [ + { + "from": { "apple_vendor_top_case_key_code": "keyboard_fn" }, + "to": [{ "key_code": "left_command" }] + }, + { + "from": { "key_code": "left_command" }, + "to": [{ "apple_vendor_top_case_key_code": "keyboard_fn" }] + } + ], + "virtual_hid_keyboard": { "keyboard_type_v2": "ansi" } + }, + { + "complex_modifications": { + "rules": [ + { + "description": "Change left_control+hnei to arrow keys", + "manipulators": [ + { + "from": { + "key_code": "h", + "modifiers": { + "mandatory": ["left_control"], + "optional": ["any"] + } + }, + "to": [{ "key_code": "left_arrow" }], + "type": "basic" + }, + { + "from": { + "key_code": "n", + "modifiers": { + "mandatory": ["left_control"], + "optional": ["any"] + } + }, + "to": [{ "key_code": "down_arrow" }], + "type": "basic" + }, + { + "from": { + "key_code": "e", + "modifiers": { + "mandatory": ["left_control"], + "optional": ["any"] + } + }, + "to": [{ "key_code": "up_arrow" }], + "type": "basic" + }, + { + "from": { + "key_code": "i", + "modifiers": { + "mandatory": ["left_control"], + "optional": ["any"] + } + }, + "to": [{ "key_code": "right_arrow" }], + "type": "basic" + } + ] + } + ] + }, + "devices": [ + { + "identifiers": { + "is_keyboard": true, + "is_pointing_device": true, + "product_id": 626, + "vendor_id": 5426 + }, + "ignore": false, + "mouse_flip_y": true, + "simple_modifications": [ + { + "from": { "key_code": "left_command" }, + "to": [{ "key_code": "right_control" }] + }, + { + "from": { "key_code": "left_control" }, + "to": [{ "key_code": "left_command" }] + } + ] + }, + { + "identifiers": { + "is_pointing_device": true, + "product_id": 45088, + "vendor_id": 1133 + }, + "ignore": false, + "mouse_flip_vertical_wheel": true + } + ], + "name": "Default profile (copy)", + "simple_modifications": [ + { + "from": { "apple_vendor_top_case_key_code": "keyboard_fn" }, + "to": [{ "key_code": "left_command" }] + }, + { + "from": { "key_code": "left_command" }, + "to": [{ "apple_vendor_top_case_key_code": "keyboard_fn" }] + } + ], + "virtual_hid_keyboard": { "keyboard_type_v2": "ansi" } + } + ] +} \ No newline at end of file diff --git a/mac/karabiner/readme.md b/mac/karabiner/readme.md new file mode 100644 index 0000000..53343b0 --- /dev/null +++ b/mac/karabiner/readme.md @@ -0,0 +1,4 @@ +# Karabiner + +- `karabiner.json` is the configuration file for Karabiner-Elements, located in `~/.config/karabiner/`. +- Other files are considered as snippets for the configuration file. \ No newline at end of file diff --git a/setup/mac_setup.sh b/setup/mac_setup.sh index 770fa92..4b0640d 100644 --- a/setup/mac_setup.sh +++ b/setup/mac_setup.sh @@ -71,9 +71,10 @@ ln -sf $DOTFILES/zsh/.zshenv $ZDOTDIR/.zshenv ln -sf $DOTFILES/mac/.zshrc $ZDOTDIR/.zshrc mv ~/.zprofile $ZDOTDIR/.zprofile source $ZDOTDIR/.zshrc -sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" -git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH/custom/plugins/zsh-autosuggestions -git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH/custom/plugins/zsh-syntax-highlighting +# sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +mkdir -p $ZDOTDIR/plugins +git clone https://github.com/zsh-users/zsh-autosuggestions $ZDOTDIR/plugins/zsh-autosuggestions +git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZDOTDIR/plugins/zsh-syntax-highlighting source /etc/zshenv source $ZDOTDIR/.zshrc rm -f ~/.zshrc ~/.zprofile ~/.zsh_history ~/.zshenv @@ -280,4 +281,8 @@ duti -s com.colliderli.iina .mp4 all duti -s com.colliderli.iina .mkv all mkdir -p $DOTFILES/powershell_private -touch $ZDOTDIR/.private.env.sh \ No newline at end of file + +mkdir -p ~/Documents/Source/Forks +mkdir -p ~/Documents/Source/Projects +mkdir -p ~/Documents/Source/Scripts +mkdir -p ~/Documents/Source/Tutorials \ No newline at end of file diff --git a/zsh/update.sh b/zsh/update.sh index 3c660ae..6bb0f30 100644 --- a/zsh/update.sh +++ b/zsh/update.sh @@ -11,3 +11,8 @@ for plugin in $ZDOTDIR/plugins/*; do git pull --quiet --no-edit fi done + +if [ which brew > /dev/null ]; then + brew update + brew upgrade +fi \ No newline at end of file