lupan-set-theme: toggle st theme (note: needs st patched to handle USR1)

This commit is contained in:
2025-09-21 18:59:34 +02:00
parent 8fded47ae8
commit 343b2ce321
2 changed files with 58 additions and 0 deletions

View File

@@ -19,6 +19,16 @@ else
exit 1
fi
if [ -f ~/.Xresources ]; then
if [ "$THEME" = dark ]; then
sed -i 's/^#undef THEME_DARK/#define THEME_DARK/' ~/.Xresources
elif [ "$THEME" = light ]; then
sed -i 's/^#define THEME_DARK/#undef THEME_DARK/' ~/.Xresources
fi
xrdb -merge ~/.Xresources
killall -USR1 st
fi
# Alacritty
if [ -f ~/.config/alacritty/alacritty.yml ]; then
sed -i "s/^colors: [*].*/colors: *$THEME/" ~/.config/alacritty/alacritty.yml