dotfiles/bin/bin/toggle-color-mode

22 lines
565 B
Bash
Executable file

#!/bin/bash
color_file=$HOME/.config/atomaka/color.yml
if ! test -f $color_file; then
mkdir -p $HOME/.config/atomaka
echo light > $color_file
fi
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