diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4b2051d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +alacritty/.config/alacritty/alacritty.yml +atomaka/.config/atomaka/color.yml diff --git a/Makefile b/Makefile index 0589784..1c576c3 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ -STOWED = bin git ruby tmux vim zsh alacritty +STOWED = bin git ruby tmux vim zsh alacritty atomaka all: install -install: plug-vim +install: plug-vim initialize-colors stow $(STOWED) uninstall: @@ -14,6 +14,10 @@ plug-vim: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim ; \ fi +initialize-colors: + cat alacritty/.config/alacritty/alacritty-base.yml alacritty/.config/alacritty/themes/dark.yml > alacritty/.config/alacritty/alacritty.yml + cp atomaka/.config/atomaka/color.sample.yml atomaka/.config/atomaka/color.yml + rbenv: rbenv-base rbenv-build rbenv-base: diff --git a/alacritty/.config/alacritty/alacritty.yml b/alacritty/.config/alacritty/alacritty-base.yml similarity index 100% rename from alacritty/.config/alacritty/alacritty.yml rename to alacritty/.config/alacritty/alacritty-base.yml diff --git a/alacritty/.config/alacritty/themes/dark.yml b/alacritty/.config/alacritty/themes/dark.yml new file mode 100644 index 0000000..36aebf9 --- /dev/null +++ b/alacritty/.config/alacritty/themes/dark.yml @@ -0,0 +1,28 @@ + # Colors (Solarized Dark) +colors: + # Default colors + primary: + background: '0x002b36' + foreground: '0x839496' + + # Normal colors + normal: + black: '0x073642' + red: '0xdc322f' + green: '0x859900' + yellow: '0xb58900' + blue: '0x268bd2' + magenta: '0xd33682' + cyan: '0x2aa198' + white: '0xeee8d5' + + # Bright colors + bright: + black: '0x002b36' + red: '0xcb4b16' + green: '0x586e75' + yellow: '0x657b83' + blue: '0x839496' + magenta: '0x6c71c4' + cyan: '0x93a1a1' + white: '0xfdf6e3' diff --git a/alacritty/.config/alacritty/themes/light.yml b/alacritty/.config/alacritty/themes/light.yml new file mode 100644 index 0000000..f111ab1 --- /dev/null +++ b/alacritty/.config/alacritty/themes/light.yml @@ -0,0 +1,28 @@ + # Colors (Solarized Light) +colors: + # Default colors + primary: + background: '0xfdf6e3' + foreground: '0x586e75' + + # Normal colors + normal: + black: '0x073642' + red: '0xdc322f' + green: '0x859900' + yellow: '0xb58900' + blue: '0x268bd2' + magenta: '0xd33682' + cyan: '0x2aa198' + white: '0xeee8d5' + + # Bright colors + bright: + black: '0x002b36' + red: '0xcb4b16' + green: '0x586e75' + yellow: '0x657b83' + blue: '0x839496' + magenta: '0x6c71c4' + cyan: '0x93a1a1' + white: '0xfdf6e3' diff --git a/atomaka/.config/atomaka/color.sample.yml b/atomaka/.config/atomaka/color.sample.yml new file mode 100644 index 0000000..4520e2f --- /dev/null +++ b/atomaka/.config/atomaka/color.sample.yml @@ -0,0 +1 @@ +dark diff --git a/bin/bin/cs b/bin/bin/cs new file mode 100755 index 0000000..0be3ccf --- /dev/null +++ b/bin/bin/cs @@ -0,0 +1,27 @@ +#!/bin/bash + +color_file=$HOME/.config/atomaka/color.yml +old_color=$(cat $color_file) + +if [[ $old_color == "dark" ]]; then + new_color=light +else + new_color=dark +fi + +alacritty_header=" # Dynamically generated. Edit $HOME/.config/alacritty/alacritty-base.yml" + +alacritty=$HOME/.config/alacritty/ +echo $alacritty_header > $alacritty/alacritty.yml +cat $alacritty/alacritty-base.yml $alacritty/themes/$new_color.yml >> $alacritty/alacritty.yml + +echo $new_color > $color_file + +for pane_info in $(tmux list-panes -a -F '#{pane_id}-#{pane_current_command}'); do + IFS=- read pane cmd <<< "$pane_info" + + if [[ $cmd == "vim" ]]; then + echo "sending to $pane" + tmux send-keys -t $pane ":call ChangeBackground()" ENTER + fi +done diff --git a/vim/.vimrc b/vim/.vimrc index a84606c..7513eb7 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -2,7 +2,7 @@ call plug#begin('~/.vim/plugged') " colors -Plug 'joshdick/onedark.vim' +Plug 'altercation/vim-colors-solarized' " keepers Plug 'airblade/vim-gitgutter' @@ -167,8 +167,8 @@ set cursorline " Highlight current line set cursorcolumn " Highlight current column set termguicolors -colorscheme onedark syntax enable +colorscheme solarized highlight ExtraWhitespace ctermbg=196 @@ -187,3 +187,9 @@ function! ZoomState() return '' endif endfunction + +" colors +function! ChangeBackground() + let &background=readfile(glob("~/.config/atomaka/color.yml"))[0] +endfunction +call ChangeBackground()