From a55bcab62ee5d7198ee11a8e801895404d5d14cf Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Fri, 22 Apr 2016 18:24:36 +0100 Subject: Add base16 colorscheme --- .gitmodules | 3 ++ Xresources/.Xresources/Tomorrow | 23 --------- Xresources/.Xresources/Tomorrow-Night | 23 --------- Xresources/.Xresources/Tomorrow-Night-Blue | 23 --------- Xresources/.Xresources/Tomorrow-Night-Bright | 23 --------- Xresources/.Xresources/Tomorrow-Night-Eighties | 23 --------- Xresources/.Xresources/base | 31 ------------ Xresources/.Xresources/base.xresources | 31 ++++++++++++ Xresources/.Xresources/base16 | 1 + Xresources/.Xresources/seoul256 | 29 ----------- Xresources/.Xresources/seoul256.dark.xresources | 27 +++++++++++ Xresources/.Xresources/solarized-dark | 28 ----------- Xresources/.Xresources/solarized-light | 28 ----------- Xresources/.Xresources/solarized.dark.xresources | 26 ++++++++++ Xresources/.Xresources/solarized.light.xresources | 26 ++++++++++ Xresources/.Xresources/transparent | 5 -- Xresources/.Xresources/transparent.xresources | 3 ++ vim/.vim/vim-plug | 2 +- vim/.vimrc | 3 +- xinit/.xinitrc | 2 +- zsh/.zsh/functions | 59 +++++++++++++++-------- zsh/.zshrc | 1 - 22 files changed, 161 insertions(+), 259 deletions(-) delete mode 100644 Xresources/.Xresources/Tomorrow delete mode 100644 Xresources/.Xresources/Tomorrow-Night delete mode 100644 Xresources/.Xresources/Tomorrow-Night-Blue delete mode 100644 Xresources/.Xresources/Tomorrow-Night-Bright delete mode 100644 Xresources/.Xresources/Tomorrow-Night-Eighties delete mode 100644 Xresources/.Xresources/base create mode 100644 Xresources/.Xresources/base.xresources create mode 160000 Xresources/.Xresources/base16 delete mode 100644 Xresources/.Xresources/seoul256 create mode 100644 Xresources/.Xresources/seoul256.dark.xresources delete mode 100644 Xresources/.Xresources/solarized-dark delete mode 100644 Xresources/.Xresources/solarized-light create mode 100644 Xresources/.Xresources/solarized.dark.xresources create mode 100644 Xresources/.Xresources/solarized.light.xresources delete mode 100644 Xresources/.Xresources/transparent create mode 100644 Xresources/.Xresources/transparent.xresources diff --git a/.gitmodules b/.gitmodules index 64ed203..2e79e83 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "zsh/.zsh/zgen"] path = zsh/.zsh/zgen url = https://github.com/tarjoilija/zgen +[submodule "Xresources/.Xresources/base16"] + path = Xresources/.Xresources/base16 + url = https://github.com/chriskempson/base16-xresources diff --git a/Xresources/.Xresources/Tomorrow b/Xresources/.Xresources/Tomorrow deleted file mode 100644 index 680fcc4..0000000 --- a/Xresources/.Xresources/Tomorrow +++ /dev/null @@ -1,23 +0,0 @@ -# include ".Xresources/base" - -URxvt*foreground: #4d4d4c -URxvt*background: #ffffff -URxvt*borderColor: #ffffff -URxvt*cursorColor: #aeafad - -URxvt*color0: #000000 -URxvt*color8: #666666 -URxvt*color1: #c82829 -URxvt*color9: #FF3334 -URxvt*color2: #718c00 -URxvt*color10: #9ec400 -URxvt*color3: #f5871f -URxvt*color11: #eab700 -URxvt*color4: #4271ae -URxvt*color12: #4271ae -URxvt*color5: #8959a8 -URxvt*color13: #b777e0 -URxvt*color6: #3e999f -URxvt*color14: #54ced6 -URxvt*color7: #d6d6d6 -URxvt*color15: #efefef diff --git a/Xresources/.Xresources/Tomorrow-Night b/Xresources/.Xresources/Tomorrow-Night deleted file mode 100644 index cd6a958..0000000 --- a/Xresources/.Xresources/Tomorrow-Night +++ /dev/null @@ -1,23 +0,0 @@ -# include ".Xresources/base" - -URxvt*foreground: #c5c8c6 -URxvt*background: #1d1f21 -URxvt*borderColor: #1d1f21 -URxvt*cursorColor: #aeafad - -URxvt*color0: #000000 -URxvt*color8: #666666 -URxvt*color1: #cc6666 -URxvt*color9: #FF3334 -URxvt*color2: #b5bd68 -URxvt*color10: #9ec400 -URxvt*color3: #de935f -URxvt*color11: #f0c674 -URxvt*color4: #81a2be -URxvt*color12: #81a2be -URxvt*color5: #b294bb -URxvt*color13: #b777e0 -URxvt*color6: #8abeb7 -URxvt*color14: #54ced6 -URxvt*color7: #373b41 -URxvt*color15: #282a2e diff --git a/Xresources/.Xresources/Tomorrow-Night-Blue b/Xresources/.Xresources/Tomorrow-Night-Blue deleted file mode 100644 index 693ab61..0000000 --- a/Xresources/.Xresources/Tomorrow-Night-Blue +++ /dev/null @@ -1,23 +0,0 @@ -# include ".Xresources/base" - -URxvt*foreground: #ffffff -URxvt*background: #002451 -URxvt*borderColor: #002451 -URxvt*cursorColor: #aeafad - -URxvt*color0: #000000 -URxvt*color8: #666666 -URxvt*color1: #ff9da4 -URxvt*color9: #FF3334 -URxvt*color2: #d1f1a9 -URxvt*color10: #9ec400 -URxvt*color3: #ffc58f -URxvt*color11: #ffeead -URxvt*color4: #bbdaff -URxvt*color12: #bbdaff -URxvt*color5: #ebbbff -URxvt*color13: #b777e0 -URxvt*color6: #99ffff -URxvt*color14: #54ced6 -URxvt*color7: #003f8e -URxvt*color15: #00346e diff --git a/Xresources/.Xresources/Tomorrow-Night-Bright b/Xresources/.Xresources/Tomorrow-Night-Bright deleted file mode 100644 index 14f57b1..0000000 --- a/Xresources/.Xresources/Tomorrow-Night-Bright +++ /dev/null @@ -1,23 +0,0 @@ -# include ".Xresources/base" - -URxvt*foreground: #eaeaea -URxvt*background: #000000 -URxvt*borderColor: #000000 -URxvt*cursorColor: #aeafad - -URxvt*color0: #000000 -URxvt*color8: #666666 -URxvt*color1: #d54e53 -URxvt*color9: #FF3334 -URxvt*color2: #b9ca4a -URxvt*color10: #9ec400 -URxvt*color3: #e78c45 -URxvt*color11: #e7c547 -URxvt*color4: #7aa6da -URxvt*color12: #7aa6da -URxvt*color5: #c397d8 -URxvt*color13: #b777e0 -URxvt*color6: #70c0b1 -URxvt*color14: #54ced6 -URxvt*color7: #424242 -URxvt*color15: #2a2a2a diff --git a/Xresources/.Xresources/Tomorrow-Night-Eighties b/Xresources/.Xresources/Tomorrow-Night-Eighties deleted file mode 100644 index 0a7dff7..0000000 --- a/Xresources/.Xresources/Tomorrow-Night-Eighties +++ /dev/null @@ -1,23 +0,0 @@ -# include ".Xresources/base" - -URxvt*foreground: #cccccc -URxvt*background: #2d2d2d -URxvt.borderColor: #2d2d2d -URxvt*cursorColor: #aeafad - -URxvt*color0: #000000 -URxvt*color8: #666666 -URxvt*color1: #f2777a -URxvt*color9: #FF3334 -URxvt*color2: #99cc99 -URxvt*color10: #9ec400 -URxvt*color3: #f99157 -URxvt*color11: #ffcc66 -URxvt*color4: #6699cc -URxvt*color12: #6699cc -URxvt*color5: #cc99cc -URxvt*color13: #b777e0 -URxvt*color6: #66cccc -URxvt*color14: #54ced6 -URxvt*color7: #515151 -URxvt*color15: #393939 diff --git a/Xresources/.Xresources/base b/Xresources/.Xresources/base deleted file mode 100644 index 6a17306..0000000 --- a/Xresources/.Xresources/base +++ /dev/null @@ -1,31 +0,0 @@ -! URXVT ! - -! General settings -URxvt.loginShell : true -URxvt.termName : rxvt-256color - -! Custom META key -URxvt*modifier: alt - -! Copy-paste configuration -URxvt.clipboard.copycmd: xclip -i -selection clipboard -URxvt.clipboard.pastecmd: xclip -o -selection clipboard - -! Perl extensions configuration -URxvt.perl-ext-common: default,clipboard,url-select,keyboard-select,resize -URxvt.url-select.launcher: /usr/bin/qutebrowser -URxvt.url-select.underline: true - -! Key bindings for extensions -URxvt.keysym.M-Escape: perl:keyboard-select:activate -URxvt.keysym.M-s: perl:keyboard-select:search -URxvt.keysym.M-u: perl:url-select:select_next -URxvt.keysym.M-y: perl:clipboard:copy -URxvt.keysym.M-p: perl:clipboard:paste -URxvt.resize-font.smaller: C-minus -URxvt.resize-font.bigger: C-plus - -! Appearance -URxvt*font: xft:DejaVu Sans Mono:size=12 -URxvt*scrollBar: false -URxvt*internalBorder: 0 diff --git a/Xresources/.Xresources/base.xresources b/Xresources/.Xresources/base.xresources new file mode 100644 index 0000000..6a17306 --- /dev/null +++ b/Xresources/.Xresources/base.xresources @@ -0,0 +1,31 @@ +! URXVT ! + +! General settings +URxvt.loginShell : true +URxvt.termName : rxvt-256color + +! Custom META key +URxvt*modifier: alt + +! Copy-paste configuration +URxvt.clipboard.copycmd: xclip -i -selection clipboard +URxvt.clipboard.pastecmd: xclip -o -selection clipboard + +! Perl extensions configuration +URxvt.perl-ext-common: default,clipboard,url-select,keyboard-select,resize +URxvt.url-select.launcher: /usr/bin/qutebrowser +URxvt.url-select.underline: true + +! Key bindings for extensions +URxvt.keysym.M-Escape: perl:keyboard-select:activate +URxvt.keysym.M-s: perl:keyboard-select:search +URxvt.keysym.M-u: perl:url-select:select_next +URxvt.keysym.M-y: perl:clipboard:copy +URxvt.keysym.M-p: perl:clipboard:paste +URxvt.resize-font.smaller: C-minus +URxvt.resize-font.bigger: C-plus + +! Appearance +URxvt*font: xft:DejaVu Sans Mono:size=12 +URxvt*scrollBar: false +URxvt*internalBorder: 0 diff --git a/Xresources/.Xresources/base16 b/Xresources/.Xresources/base16 new file mode 160000 index 0000000..6c9a5bf --- /dev/null +++ b/Xresources/.Xresources/base16 @@ -0,0 +1 @@ +Subproject commit 6c9a5bfa876dca27a20e2a701fb9bd851bbc107b diff --git a/Xresources/.Xresources/seoul256 b/Xresources/.Xresources/seoul256 deleted file mode 100644 index 8b282e9..0000000 --- a/Xresources/.Xresources/seoul256 +++ /dev/null @@ -1,29 +0,0 @@ -# include ".Xresources/base" - -! Border color -URxvt.borderColor: #3a3a3a - -! Background / Foreground -URxvt*background: #3a3a3a -URxvt*foreground: #d0d0d0 - -! Other colors -URxvt*color0: #4e4e4e -URxvt*color1: #d68787 -URxvt*color2: #5f865f -URxvt*color3: #d8af5f -URxvt*color4: #85add4 -URxvt*color5: #d7afaf -URxvt*color6: #87afaf -URxvt*color7: #d0d0d0 -URxvt*color8: #626262 -URxvt*color9: #d75f87 -URxvt*color10: #87af87 -URxvt*color11: #ffd787 -URxvt*color12: #add4fb -URxvt*color13: #ffafaf -URxvt*color14: #87d7d7 -URxvt*color15: #e4e4e4 -URxvt*cursorColor: #d0d0d0 -URxvt*cursorColor2: #3a3a3a -URxvt*colorBD: #e4e4e4 diff --git a/Xresources/.Xresources/seoul256.dark.xresources b/Xresources/.Xresources/seoul256.dark.xresources new file mode 100644 index 0000000..ad67aa5 --- /dev/null +++ b/Xresources/.Xresources/seoul256.dark.xresources @@ -0,0 +1,27 @@ +! Border color +URxvt.borderColor: #3a3a3a + +! Background / Foreground +URxvt*background: #3a3a3a +URxvt*foreground: #d0d0d0 + +! Other colors +URxvt*color0: #4e4e4e +URxvt*color1: #d68787 +URxvt*color2: #5f865f +URxvt*color3: #d8af5f +URxvt*color4: #85add4 +URxvt*color5: #d7afaf +URxvt*color6: #87afaf +URxvt*color7: #d0d0d0 +URxvt*color8: #626262 +URxvt*color9: #d75f87 +URxvt*color10: #87af87 +URxvt*color11: #ffd787 +URxvt*color12: #add4fb +URxvt*color13: #ffafaf +URxvt*color14: #87d7d7 +URxvt*color15: #e4e4e4 +URxvt*cursorColor: #d0d0d0 +URxvt*cursorColor2: #3a3a3a +URxvt*colorBD: #e4e4e4 diff --git a/Xresources/.Xresources/solarized-dark b/Xresources/.Xresources/solarized-dark deleted file mode 100644 index 1c51f21..0000000 --- a/Xresources/.Xresources/solarized-dark +++ /dev/null @@ -1,28 +0,0 @@ -# include ".Xresources/base" - -URxvt.borderColor: #002b36 - -*background: #002b36 -*foreground: #839496 -*fadeColor: #002b36 -*cursorColor: #93a1a1 - -*pointerColorBackground: #586e75 -*pointerColorForeground: #93a1a1 - -*color0: #073642 -*color8: #002b36 -*color1: #dc322f -*color9: #cb4b16 -*color2: #859900 -*color10: #586e75 -*color3: #b58900 -*color11: #657b83 -*color4: #268bd2 -*color12: #839496 -*color5: #d33682 -*color13: #6c71c4 -*color6: #2aa198 -*color14: #93a1a1 -*color7: #eee8d5 -*color15: #fdf6e3 diff --git a/Xresources/.Xresources/solarized-light b/Xresources/.Xresources/solarized-light deleted file mode 100644 index c4b962d..0000000 --- a/Xresources/.Xresources/solarized-light +++ /dev/null @@ -1,28 +0,0 @@ -# include ".Xresources/base" - -URxvt.borderColor: #fdf6e3 - -*background: #fdf6e3 -*foreground: #657b83 -*fadeColor: #fdf6e3 -*cursorColor: #586e75 - -*pointerColorBackground: #93a1a1 -*pointerColorForeground: #586e75 - -*color0: #073642 -*color8: #002b36 -*color1: #dc322f -*color9: #cb4b16 -*color2: #859900 -*color10: #586e75 -*color3: #b58900 -*color11: #657b83 -*color4: #268bd2 -*color12: #839496 -*color5: #d33682 -*color13: #6c71c4 -*color6: #2aa198 -*color14: #93a1a1 -*color7: #eee8d5 -*color15: #fdf6e3 diff --git a/Xresources/.Xresources/solarized.dark.xresources b/Xresources/.Xresources/solarized.dark.xresources new file mode 100644 index 0000000..c820c23 --- /dev/null +++ b/Xresources/.Xresources/solarized.dark.xresources @@ -0,0 +1,26 @@ +URxvt.borderColor: #002b36 + +*background: #002b36 +*foreground: #839496 +*fadeColor: #002b36 +*cursorColor: #93a1a1 + +*pointerColorBackground: #586e75 +*pointerColorForeground: #93a1a1 + +*color0: #073642 +*color8: #002b36 +*color1: #dc322f +*color9: #cb4b16 +*color2: #859900 +*color10: #586e75 +*color3: #b58900 +*color11: #657b83 +*color4: #268bd2 +*color12: #839496 +*color5: #d33682 +*color13: #6c71c4 +*color6: #2aa198 +*color14: #93a1a1 +*color7: #eee8d5 +*color15: #fdf6e3 diff --git a/Xresources/.Xresources/solarized.light.xresources b/Xresources/.Xresources/solarized.light.xresources new file mode 100644 index 0000000..5d076f4 --- /dev/null +++ b/Xresources/.Xresources/solarized.light.xresources @@ -0,0 +1,26 @@ +URxvt.borderColor: #fdf6e3 + +*background: #fdf6e3 +*foreground: #657b83 +*fadeColor: #fdf6e3 +*cursorColor: #586e75 + +*pointerColorBackground: #93a1a1 +*pointerColorForeground: #586e75 + +*color0: #073642 +*color8: #002b36 +*color1: #dc322f +*color9: #cb4b16 +*color2: #859900 +*color10: #586e75 +*color3: #b58900 +*color11: #657b83 +*color4: #268bd2 +*color12: #839496 +*color5: #d33682 +*color13: #6c71c4 +*color6: #2aa198 +*color14: #93a1a1 +*color7: #eee8d5 +*color15: #fdf6e3 diff --git a/Xresources/.Xresources/transparent b/Xresources/.Xresources/transparent deleted file mode 100644 index 0791609..0000000 --- a/Xresources/.Xresources/transparent +++ /dev/null @@ -1,5 +0,0 @@ -# include "solarized-dark" - -! True transparency -URxvt.transparent: true -URxvt.shading: 10 diff --git a/Xresources/.Xresources/transparent.xresources b/Xresources/.Xresources/transparent.xresources new file mode 100644 index 0000000..39d696c --- /dev/null +++ b/Xresources/.Xresources/transparent.xresources @@ -0,0 +1,3 @@ +! True transparency +URxvt.transparent: true +URxvt.shading: 10 diff --git a/vim/.vim/vim-plug b/vim/.vim/vim-plug index 0507fc8..41de3c7 160000 --- a/vim/.vim/vim-plug +++ b/vim/.vim/vim-plug @@ -1 +1 @@ -Subproject commit 0507fc897e3d4d95604e9d4298045eb6750d8ae0 +Subproject commit 41de3c713c0b82700bfcb50a45e9d7756a2cce96 diff --git a/vim/.vimrc b/vim/.vimrc index d084e70..9b17ea2 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -4,6 +4,7 @@ let maplocalleader = "\\" "" Plugins call plug#begin('~/.vim/plugged') +Plug 'chriskempson/base16-vim' Plug 'airblade/vim-gitgutter' Plug 'altercation/vim-colors-solarized' Plug 'beloglazov/vim-online-thesaurus' @@ -199,7 +200,6 @@ set breakindent let &showbreak='--> ' set colorcolumn=0 set scrolloff=0 -set t_Co=256 set guitablabel=%N\ %t\ %M set showcmd @@ -232,6 +232,7 @@ au BufNewFile,BufRead *.edp comp freefem au BufNewFile,BufRead *.geo setf gmsh " Colorscheme +let base16colorspace=256 silent! colo $COLORSCHEME if $BACKGROUND=="dark" set background=dark diff --git a/xinit/.xinitrc b/xinit/.xinitrc index 92a562b..6b014cd 100755 --- a/xinit/.xinitrc +++ b/xinit/.xinitrc @@ -7,7 +7,7 @@ xset r rate 400 50 $HOME/bin/keyboard # Load Xresources to light colorscheme -xrdb -I$HOME ~/.Xresources/Tomorrow-Night-Eighties +xrdb ~/.Xresources/base.xresources # Background feh --bg-fill --randomize /usr/share/backgrounds diff --git a/zsh/.zsh/functions b/zsh/.zsh/functions index f916655..aad8b01 100644 --- a/zsh/.zsh/functions +++ b/zsh/.zsh/functions @@ -1,42 +1,63 @@ +#!/bin/zsh + if [[ -z ${ZSH_COLORS} ]]; then ZSH_COLORS=${HOME}/.local/share/zsh/colors.zsh fi -if [[ -f ${ZSH_COLORS} ]]; then - source ${ZSH_COLORS} -fi +colorschemes=$(echo ${HOME}/.Xresources/**/* | sed "s#${HOME}/.Xresources/##g" | sed 's#base16/base16-##g') function colo { # Xresource file - XRESOURCE=$1 - - if [[ "${XRESOURCE}" == *"-dark" ]]; then - export COLORSCHEME=${XRESOURCE%-dark} - export BACKGROUND="dark" - elif [[ "${XRESOURCE}" == *"-light" ]]; then - export COLORSCHEME=${XRESOURCE%-light} - export BACKGROUND="light" - else - export COLORSCHEME=${XRESOURCE} - export BACKGROUND="" + if [[ -z $1 ]]; then + XRESOURCE=$(echo ${colorschemes} | sed 's/ /\n/g' | fzf) + else + XRESOURCE=$1 + fi + if [[ -z ${XRESOURCE} ]]; then + return + fi + if [[ ! -f ${HOME}/.Xresources/${XRESOURCE} ]]; then + XRESOURCE=base16/base16-${XRESOURCE} + fi + if [[ ! -f ${HOME}/.Xresources/${XRESOURCE} ]]; then + echo "Invalid colorscheme!" + return fi # Change colors for current session - cat ~/.Xresources/${XRESOURCE} | tr -d ' \t' | sed -n \ + /usr/bin/cpp ~/.Xresources/${XRESOURCE} | tr -d ' \t' | sed -n \ -e 's/.*background:/\x1b]11;/p' \ -e 's/.*foreground:/\x1b]10;/p' \ - -e 's/.*borderColor:/\x1b]708;/p' \ -e 's/.*color\([0-9][^:]*\):/\x1b]4;\1;/p' | tr \\n \\a - + + # Ensure border color is the same as background + bg=$(/usr/bin/cpp ~/.Xresources/${XRESOURCE} | grep "background" | sed 's/[^ ]\+[ ]\+\([^ ]\+\)$/\1/') + echo "\x1b]708;${bg}" | tr \\n \\a + # Load Xresources file for future sessions - xrdb -I$HOME ~/.Xresources/${XRESOURCE} + xrdb ~/.Xresources/base.xresources + xrdb -merge ~/.Xresources/${XRESOURCE} + xrdb -merge <<< "URxvt.borderColor: ${bg}" # Change default environment variable for future sessions mkdir -p $(dirname ${ZSH_COLORS}) + + COLORSCHEME=$(echo $(basename ${XRESOURCE}) | sed 's/\([^.]\+\)\..\+$/\1/g') + BACKGROUND=$(echo ${XRESOURCE} | sed 's/^.\+\(dark\|light\).\+$/\1/') + echo "export COLORSCHEME=${COLORSCHEME}" > ${ZSH_COLORS} echo "export BACKGROUND=${BACKGROUND}" >> ${ZSH_COLORS} + echo "export XRESOURCE=${XRESOURCE}" >> ${ZSH_COLORS} + source ${ZSH_COLORS} } +# Source colors +if [[ -f ${ZSH_COLORS} ]]; then + source ${ZSH_COLORS} + colo ${XRESOURCE} + # echo "sourced ${XRESOURCE}" +fi + # Completion for colorschemes (-M -> Case insensitive) -compctl -k "($(ls ${HOME}/.Xresources))" -M 'm:{a-z}={A-Z}' colo +compctl -k "(${colorschemes})" -M 'm:{a-z}={A-Z}' colo diff --git a/zsh/.zshrc b/zsh/.zshrc index fe44e9e..8fb638c 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -5,7 +5,6 @@ source "$HOME/.zsh/plugins" source "$HOME/.zsh/functions" source "$HOME/.zsh/alias" -source "$HOME/.zsh/tmp" # Custom key bindings for built-in widgets bindkey -a 'k' history-beginning-search-backward -- cgit v1.2.3