aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/.local/bin')
-rwxr-xr-xdotfiles/.local/bin/chcolors20
1 files changed, 20 insertions, 0 deletions
diff --git a/dotfiles/.local/bin/chcolors b/dotfiles/.local/bin/chcolors
new file mode 100755
index 0000000..7732267
--- /dev/null
+++ b/dotfiles/.local/bin/chcolors
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+COLORSCHEME="dark"
+
+if [ -f $HOME/.cache/colorscheme ]; then
+ source $HOME/.cache/colorscheme
+fi
+
+case $COLORSCHEME in
+ dark)
+ COLORSCHEME="light" ;;
+ *)
+ COLORSCHEME="dark" ;;
+esac
+
+sed -i --follow-symlinks \
+ "s/^colors:.*/colors: \*$COLORSCHEME/g" \
+ $HOME/.config/alacritty/alacritty.yml
+
+echo "export COLORSCHEME=$COLORSCHEME" > $HOME/.cache/colorscheme