diff options
| author | BardofSprites <[email protected]> | 2025-03-20 20:56:55 -0400 |
|---|---|---|
| committer | BardofSprites <[email protected]> | 2025-03-20 20:56:55 -0400 |
| commit | 1ba0aaecfa3448e9ce01580b34c46e4ffa343098 (patch) | |
| tree | 76825fd370f1b17df62c2b3e64257049f4dd9149 /bin | |
| parent | 34d01d56a9dabc72944a1faeb7b998cdf66f3e0c (diff) | |
xmonad color changing
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/.local/bin/scripts/xmonad-themechange | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/bin/.local/bin/scripts/xmonad-themechange b/bin/.local/bin/scripts/xmonad-themechange new file mode 100755 index 0000000..c515578 --- /dev/null +++ b/bin/.local/bin/scripts/xmonad-themechange @@ -0,0 +1,54 @@ +#!/usr/bin/bash + +themes=("Gruber Darker" "Modus Vivendi") + +selected_theme=$(printf "%s\n" "${themes[@]}" | dmenu -p "Select a theme:") + +# Exit if no theme is selected +if [ -z "$selected_theme" ]; then + exit 1 +fi + +apply_emacs_theme() { + emacsclient -e "(bard/select-theme '$1)" +} + +apply_generic_theme() { + case $selected_theme in + "Gruber Darker") + BG_COLOR="#181818" + FG_COLOR="#e4e4e4" + BORDER_COLOR="#cc8c3c" + XMONAD_MODULE="GruberDarker" + apply_emacs_theme "gruber-darker" + xrdb -merge ~/.Xresources.d/Xresources.gruber + ;; + "Modus Vivendi") + BG_COLOR="#000000" + FG_COLOR="#ffffff" + BORDER_COLOR="#989898" + XMONAD_MODULE="Modus.Vivendi" + apply_emacs_theme "modus-vivendi" + xrdb -merge ~/.Xresources.d/Xresources.vivendi + ;; + *) + BG_COLOR="#181818" + FG_COLOR="#e4e4e4" + BORDER_COLOR="#95a99f" + ;; + esac + + # Update xmonad theme library + sed -i "s/^import Colors\..*/import Colors.$XMONAD_MODULE/" ~/.config/xmonad/xmonad.hs + + # Update xmobar config file + sed -i "s/bgColor = .*/bgColor = \"$BG_COLOR\"/" ~/.config/xmobar/xmobarrc + sed -i "s/fgColor = .*/fgColor = \"$FG_COLOR\"/" ~/.config/xmobar/xmobarrc + sed -i "s/borderColor = .*/borderColor = \"$BORDER_COLOR\"/" ~/.config/xmobar/xmobarrc +} + +apply_generic_theme + +# Recompile and restart xmonad +xmonad --recompile +xmonad --restart |
