dotfiles/config/scripts/changeColors

58 lines
2.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Fetchs colors from https://github.com/chriskempson/base16 templates
# and apply them into my configuration
scheme="$1"
if [ -z "$scheme" ]
then
echo Please specify a scheme
exit 1
fi
# TODO Verify if scheme is known
mkdir -p $HOME/.local/bin
# 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" > ~/.local/bin/colorSchemeApply
chmod +x ~/.local/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" > ~/.config/Xresources/theme
# Vim
mkdir -p $HOME/.cache/vim
echo -e "let base16colorspace=256\n\"set termguicolors\ncolorscheme base16-${scheme}" > ~/.cache/vim/colorscheme.vim
# FZF
curl "https://raw.githubusercontent.com/nicodebo/base16-fzf/master/bash/base16-${scheme}.config" > ~/.local/bin/colorSchemeApplyFzf
chmod +x ~/.local/bin/colorSchemeApplyFzf
# qutebrowser
mkdir -p $HOME/.config/qutebrowser
curl "https://raw.githubusercontent.com/theova/base16-qutebrowser/master/themes/default/base16-${scheme}.config.py" > ~/.config/qutebrowser/theme.py
# rofi
mkdir -p $HOME/.config/rofi
curl "https://raw.githubusercontent.com/0xdec/base16-rofi/master/themes/base16-${scheme}.rasi" > ~/.config/rofi/theme.rasi
curl "https://raw.githubusercontent.com/0xdec/base16-rofi/master/themes/base16-${scheme}.config" > ~/.config/rofi/theme.config
# Tridactyl
mkdir -p $HOME/.config/tridactyl/themes
curl "https://raw.githubusercontent.com/bezmi/base16-tridactyl/master/base16-${scheme}.css" > ~/.config/tridactyl/themes/theme.css
# TODO dunst (template online, but not to my liking)
# TODO bar (might change bar in the future, so...)
# 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
~/.local/bin/colorSchemeApply
~/.local/bin/colorSchemeApplyFzf
# Error masking in case X not running
#xrdb -load ~/.config/Xresources/main 2> /dev/null
xrdb -I$HOME ~/.config/Xresources/main 2> /dev/null
i3-msg reload 2> /dev/null