dotfiles/xsession/bin/lupan-set-theme
Łukasz Pankowski acd4f75d63 lupan-wm: M-S-F6 switchs theme, use st as terminal
st-lupan-0.8.5.diff adapted from
http://st.suckless.org/patches/solarized/st-solarized-both-0.8.4.diff by
- change to windi colors
- switch colors with F6 or select with SIGUS1/SIGUSR2
- use font Iosevka Slab Light
2022-01-25 05:52:49 +01:00

37 lines
772 B
Bash
Executable File

#!/bin/sh
THEME="$1"
if [ "$THEME" = dark ]; then
SIGNAL=USR1
BGCOLOR=#4a4a4a
elif [ "$THEME" = light ]; then
SIGNAL=USR2
BGCOLOR=#dde1e3
else
echo "error: unknown theme: should be either dark or light" >&2
exit 1
fi
# Background color
xsetroot -solid "$BGCOLOR"
# Alacritty
if [ -f ~/.config/alacritty/alacritty.yml ]; then
sed -i "s/^colors: [*].*/colors: *lupan-$THEME/" ~/.config/alacritty/alacritty.yml
fi
# ST (patched)
pkill -$SIGNAL -x st
# GTK
if [ -f ~/.config/xsettingsd/xsettingsd.conf ]; then
sed -i -E "s#(Net/ThemeName) .*#\\1 \"Materia-$THEME\"#" ~/.config/xsettingsd/xsettingsd.conf
pkill -HUP -x xsettingsd
fi
# Emacs
if which emacsclient > /dev/null; then
emacsclient --eval "(my-select-theme '$THEME)"
fi