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 5ffcbbffcc
commit ad532f260f
2 changed files with 58 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
#define THEME_DARK
#if HEIGHT >= 2160 #if HEIGHT >= 2160
Xft.dpi: 160 Xft.dpi: 160
Xcursor.size: 48 Xcursor.size: 48
@@ -53,3 +55,49 @@ XTerm.vt100.color14: #8FBCBB
! white ! white
XTerm.vt100.color7: #E5E9F0 XTerm.vt100.color7: #E5E9F0
XTerm.vt100.color15: #ECEFF4 XTerm.vt100.color15: #ECEFF4
st.font: FiraCode Nerd Font:size=10
#ifdef THEME_DARK
st.background: #1f212e
st.foreground: #9da0af
st.cursorColor: #bf8040
st.reverse-cursor: #1f212e
st.color0: #1f212e
st.color1: #862d2d
st.color2: #3a783a
st.color3: #707010
st.color4: #345eb2
st.color5: #cc66cc
st.color6: #3a7878
st.color7: #a1a3aa
st.color8: #4d4d4d
st.color9: #c27070
st.color10: #40bf40
st.color11: #acac53
st.color12: #6b8ac7
st.color13: #8f248f
st.color14: #509595
st.color15: #dbdff0
#else
st.background: #dae4f1
st.foreground: #1f212e
st.cursorColor: #bf8040
st.reverse-cursor: #1f212e
st.color0: #1f212e
st.color1: #862d2d
st.color2: #3a783a
st.color3: #707010
st.color4: #345eb2
st.color5: #cc66cc
st.color6: #3a7878
st.color7: #a1a3aa
st.color8: #73778c
st.color9: #c27070
st.color10: #40bf40
st.color11: #acac53
st.color12: #6b8ac7
st.color13: #8f248f
st.color14: #509595
st.color15: #dae4f1
#endif

View File

@@ -19,6 +19,16 @@ else
exit 1 exit 1
fi 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 # Alacritty
if [ -f ~/.config/alacritty/alacritty.yml ]; then if [ -f ~/.config/alacritty/alacritty.yml ]; then
sed -i "s/^colors: [*].*/colors: *$THEME/" ~/.config/alacritty/alacritty.yml sed -i "s/^colors: [*].*/colors: *$THEME/" ~/.config/alacritty/alacritty.yml