From 8e43663661aec057398b038af76506f31d8aaac8 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Mon, 30 Jul 2018 10:55:06 +0200 Subject: [PATCH] COLORS --- Xresources.d/.gitignore | 1 + Xresources.d/theme | 36 ------------------------- bashrc | 8 ++++-- config/i3/config | 60 ++++++++++++++++++++--------------------- scripts/changeColors | 35 ++++++++++++++++++++++++ vimrc | 11 ++++---- 6 files changed, 77 insertions(+), 74 deletions(-) create mode 100644 Xresources.d/.gitignore delete mode 100644 Xresources.d/theme create mode 100755 scripts/changeColors diff --git a/Xresources.d/.gitignore b/Xresources.d/.gitignore new file mode 100644 index 0000000..62fd177 --- /dev/null +++ b/Xresources.d/.gitignore @@ -0,0 +1 @@ +theme diff --git a/Xresources.d/theme b/Xresources.d/theme deleted file mode 100644 index d60c7b3..0000000 --- a/Xresources.d/theme +++ /dev/null @@ -1,36 +0,0 @@ -! special -*.foreground: #f1ebeb -*.background: #272822 -*.cursorColor: #f1ebeb - -! black -*.color0: #48483e -*.color8: #76715e - -! red -*.color1: #dc2566 -*.color9: #fa2772 - -! green -*.color2: #8fc029 -*.color10: #a7e22e - -! yellow -*.color3: #d4c96e -*.color11: #e7db75 - -! blue -*.color4: #55bcce -*.color12: #66d9ee - -! magenta -*.color5: #9358fe -*.color13: #ae82ff - -! cyan -*.color6: #56b7a5 -*.color14: #66efd5 - -! white -*.color7: #acada1 -*.color15: #cfd0c2 diff --git a/bashrc b/bashrc index 45e1ba1..fda1e9a 100644 --- a/bashrc +++ b/bashrc @@ -127,11 +127,15 @@ export PATH="$HOME/.bin/:$HOME/.scripts/:$PATH" # UTILITIES +# Theme +[ -f ~/.bin/colorSchemeApply ] && source ~/.bin/colorSchemeApply +[ -f ~/.bin/colorSchemeApplyFzf ] && source ~/.bin/colorSchemeApplyFzf + # Bash completion -[ -f /etc/bash_completion ] && . /etc/bash_completion +[ -f /etc/bash_completion ] && source /etc/bash_completion # Fuzzy matching all the way -export FZF_DEFAULT_OPTS="--height 100% --layout=default" +export FZF_DEFAULT_OPTS="${FZF_DEFAULT_OPTS} --height 100% --layout=default" export FZF_CTRL_T_OPTS="--preview '[[ -d {} ]] && ls -l --color=always {} || [[ \$(file --mime {}) =~ binary ]] && echo {} is a binary file || (highlight -O ansi -l {} || coderay {} || rougify {} || cat {}) 2> /dev/null | head -500'" export FZF_COMPLETION_OPTS="${FZF_CTRL_T_OPTS}" [ -f /usr/share/fzf/completion.bash ] && source /usr/share/fzf/completion.bash diff --git a/config/i3/config b/config/i3/config index 35fb8d2..df41ee8 100644 --- a/config/i3/config +++ b/config/i3/config @@ -143,15 +143,15 @@ set $WS10 10 # Workspace output workspace "$WS1" output LVDS1 -workspace "$WS2" output VGA1 +workspace "$WS2" output HDMI1 workspace "$WS3" output LVDS1 -workspace "$WS4" output VGA1 +workspace "$WS4" output HDMI1 workspace "$WS5" output LVDS1 -workspace "$WS6" output VGA1 +workspace "$WS6" output HDMI1 workspace "$WS7" output LVDS1 -workspace "$WS8" output VGA1 +workspace "$WS8" output HDMI1 workspace "$WS9" output LVDS1 -workspace "$WS10" output VGA1 +workspace "$WS10" output HDMI1 # switch to workspace bindsym $mod+1 workspace $WS1 @@ -331,24 +331,24 @@ mode "$mode_temp" { } # Colors -set $bg #272822 -set $fg #f1ebeb -set $00 #48483e -set $01 #dc2566 -set $02 #8fc029 -set $03 #d4c96e -set $04 #55bcce -set $05 #9358fe -set $06 #56b7a5 -set $07 #acada1 -set $08 #76715e -set $09 #fa2772 -set $10 #a7e22e -set $11 #e7db75 -set $12 #66d9ee -set $13 #ae82ff -set $14 #66efd5 -set $15 #cfd0c2 +set_from_resource $background i3wm.background #272822 +set_from_resource $foreground i3wm.foreground #f1ebeb +set_from_resource $color00 i3wm.color0 #48483e +set_from_resource $color01 i3wm.color1 #dc2566 +set_from_resource $color02 i3wm.color2 #8fc029 +set_from_resource $color03 i3wm.color3 #d4c96e +set_from_resource $color04 i3wm.color4 #55bcce +set_from_resource $color05 i3wm.color5 #9358fe +set_from_resource $color06 i3wm.color6 #56b7a5 +set_from_resource $color07 i3wm.color7 #acada1 +set_from_resource $color08 i3wm.color8 #76715e +set_from_resource $color09 i3wm.color9 #fa2772 +set_from_resource $color10 i3wm.color10 #a7e22e +set_from_resource $color11 i3wm.color11 #e7db75 +set_from_resource $color12 i3wm.color12 #66d9ee +set_from_resource $color13 i3wm.color13 #ae82ff +set_from_resource $color14 i3wm.color14 #66efd5 +set_from_resource $color15 i3wm.color15 #cfd0c2 # Inactivity settings exec --no-startup-id xautolock -time 10 -locker 'xset dpms force standby' -killtime 1 -killer '$locker' @@ -373,11 +373,11 @@ exec --no-startup-id ~/.config/i3/batteryNotify -d # Battery state notification set $ignore #ff00000 # Theme colors -# class border backgr. text indicator child_border -client.focused $02 $02 $bg $07 $10 -client.focused_inactive $03 $03 $08 $15 $14 -client.unfocused $08 $08 $fg $11 $00 -client.urgent $01 $01 $fg $05 $09 -client.placeholder $ignore $06 $fg $ignore $14 +#class border backgr. text indicator child_border +client.focused $color02 $color02 $background $color08 $color10 +client.focused_inactive $color03 $color03 $color08 $color15 $color14 +client.unfocused $color08 $color08 $color07 $color11 $color00 +client.urgent $color01 $color01 $color07 $foreground $color09 +client.placeholder $ignore $color06 $color07 $ignore $color14 -client.background $15 +client.background $color15 diff --git a/scripts/changeColors b/scripts/changeColors new file mode 100755 index 0000000..4048a85 --- /dev/null +++ b/scripts/changeColors @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +# Fetchs colors from https://github.com/chriskempson/base16 templates +# and apply them into my configuration + +scheme="$1" + +# TODO Verify if scheme is known + +# Shell (allows to use all colors in Vim while still having nice colors in the rest of the terminal) +curl "https://raw.githubusercontent.com/chriskempson/base16-shell/master/scripts/base16-${scheme}.sh" > ~/.bin/colorSchemeApply +chmod +x ~/.bin/colorSchemeApply + +# Xressources (I'm not sure if this is really needed with shell overriding these but i3 load those resources) +curl "https://raw.githubusercontent.com/chriskempson/base16-xresources/master/xresources/base16-${scheme}-256.Xresources" > ~/.Xresources.d/theme + +# Vim +echo -e "let base16colorspace=256\nset termguicolors\ncolorscheme base16-${scheme}" > ~/.vim/colorscheme.vim + +# FZF +curl "https://raw.githubusercontent.com/nicodebo/base16-fzf/master/bash/base16-${scheme}.config" > ~/.bin/colorSchemeApplyFzf +chmod +x ~/.bin/colorSchemeApplyFzf + +# qutebrowser +curl "https://raw.githubusercontent.com/theova/base16-qutebrowser/4a17eea8a39f722c2cee95fb44d4a87f5eb2518f/themes/base16-${scheme}.config.py" > ~/.config/qutebrowser/theme.py + +# TODO dunst (template online, but not to my liking) +# TODO bar (might change bar in the future, so...) +# TODO qutebrowser (need to fiddle with the config thing) +# TODO highlight (there IS a template but the colors look different from vim and mostly the same from when there's no config) + +# Reload a bunch of things to make changes immediate +source ~/.bashrc +xrdb -load ~/.Xresources +i3-msg reload diff --git a/vimrc b/vimrc index 6908367..3f62987 100644 --- a/vimrc +++ b/vimrc @@ -22,7 +22,7 @@ call plug#begin() " Plug 'L9' " Plug 'rstacruz/sparkup', {'rtp': 'vim/'} -Plug 'tomasr/molokai' +Plug 'chriskempson/base16-vim' Plug 'tpope/vim-surround' " Plug 'tpope/vim-fugitive' " Plug 'tpope/vim-repeat' @@ -69,7 +69,7 @@ let g:airline#extensions#tabline#enabled = 1 let g:airline_section_a = airline#section#create(['mode']) let g:airline_section_b = airline#section#create(['branch', 'hunks']) let g:airline_section_z = airline#section#create(['%B', '@', '%l', ':', '%c']) -let g:airline_theme = 'wombat' +let g:airline_theme = 'base16' """ AUTOFORMAT """ nmap :Autoformat @@ -164,10 +164,6 @@ set splitbelow syntax enable -set background=dark -colorscheme molokai -let g:molokai_original = 1 - " From http://stackoverflow.com/a/5004785/2766106 set list set listchars=tab:╾╌,trail:·,extends:↦,precedes:↤,nbsp:_ @@ -184,6 +180,9 @@ set showcmd let vimDir = '$HOME/.vim' let &runtimepath.=','.vimDir +" theme +source $HOME/.vim/colorscheme.vim + " Keep undo history across sessions by storing it in a file if has('persistent_undo') let myUndoDir = expand(vimDir . '/undodir')