39 lines
869 B
Bash
Executable File
39 lines
869 B
Bash
Executable File
#!/bin/sh
|
|
|
|
THEME="$1"
|
|
|
|
if [ "$THEME" = dark ]; then
|
|
BGCOLOR=#4a4a4a
|
|
GTK_THEME=Materia-dark
|
|
elif [ "$THEME" = light ]; then
|
|
BGCOLOR=#dde1e3
|
|
GTK_THEME=Materia-light
|
|
elif [ "$THEME" = faff ]; then
|
|
BGCOLOR=#4a4a4a
|
|
GTK_THEME=Materia-light
|
|
else
|
|
echo "error: unknown theme: should be either dark, light or faff" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Background color
|
|
if [ ! -x ~/.fehbg ]; then
|
|
xsetroot -solid "$BGCOLOR"
|
|
fi
|
|
|
|
# Alacritty
|
|
if [ -f ~/.config/alacritty/alacritty.yml ]; then
|
|
sed -i "s/^colors: [*].*/colors: *$THEME/" ~/.config/alacritty/alacritty.yml
|
|
fi
|
|
|
|
# GTK
|
|
if [ -f ~/.config/xsettingsd/xsettingsd.conf ]; then
|
|
sed -i -E "s#(Net/ThemeName) .*#\\1 \"${GTK_THEME}\"#" ~/.config/xsettingsd/xsettingsd.conf
|
|
pkill -HUP -x xsettingsd
|
|
fi
|
|
|
|
# Emacs
|
|
if which emacsclient > /dev/null; then
|
|
emacsclient --eval "(my-select-theme '$THEME)"
|
|
fi
|