Last active
June 2, 2021 23:43
-
-
Save flee2free/fde3beb9ae9231f73ec7db44741ab5f6 to your computer and use it in GitHub Desktop.
Revisions
-
flee2free renamed this gist
Jun 2, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
flee2free created this gist
Jun 2, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,66 @@ alacritty_theme() { theme=$1 config_path=~/.config/alacritty/color.yml if ! test -f "$config_path"; then echo "$config_path does not exists" return fi sed -i "" -e "s/^colors: \*.*/colors: *$theme/g" $config_path echo "switched to $theme" } vi_theme() { for wix in `tmux list-windows -t main -F 'main:#{window_index}'`; do for tix in `tmux list-panes -t $wix -F 'main:#{window_index}.#{pane_index}.#{pane_tty}'`; do pat='(main:[0-9].[0-9]).(.*)' [[ $tix =~ $pat ]] _pane_tty="${BASH_REMATCH[2]}" _pane_id="${BASH_REMATCH[1]}" _nvim=$(ps -o state= -o comm= -t $_pane_tty | grep -c 'nvim') if [ $_nvim == 1 ]; then tmux if-shell -t "$_pane_id" "true" "send-keys -t $_pane_id Escape" tmux if-shell -t "$_pane_id" "true" "send-keys -t $_pane_id ':call ChangeBackground()' ENTER" fi done done } _light() { alacritty_theme gruvbox_light sed -i "" -e "s/^\([[:space:]]*\)\(export FZF_DEFAULT_OPTS=\)\(.*\)/\1\2\$fzf_theme_light/g" ~/.zshrc sed -i "" -e "s/^\(export BAT_THEME=\).*/\1\"gruvbox-light\"/g" ~/.zshrc sed -i "" -e "s/^\(set background=\).*/\1light/g" ~/.config/nvim/init.vim sed -i "" -e "s/\(.*active_window_border_color.*\)\".*\"/\1\"0xE03e5ea3\"/g" ~/.config/yabai/yabairc } _dark() { alacritty_theme gruvbox_dark sed -i "" -e "s/^\([[:space:]]*\)\(export FZF_DEFAULT_OPTS=\)\(.*\)/\1\2\$fzf_theme_dark/g" ~/.zshrc sed -i "" -e "s/^\(export BAT_THEME=\).*/\1\"gruvbox-dark\"/g" ~/.zshrc sed -i "" -e "s/^\(set background=\).*/\1dark/g" ~/.config/nvim/init.vim sed -i "" -e "s/\(.*active_window_border_color.*\)\".*\"/\1\"0xE04caf50\"/g" ~/.config/yabai/yabairc } case $1 in light) echo "Light" _light ;; dark) echo "Dark" _dark ;; *) echo "Unknown Option" esac vi_theme