updated wallpaper switcher to now also automatically switch DMS config, so it works with the DMS pre-made themes.

This commit is contained in:
2026-06-01 13:25:24 +02:00
parent 3629c8633c
commit 377d065240
35 changed files with 1312 additions and 123 deletions
+39 -1
View File
@@ -14,7 +14,45 @@ if [[ $SELECTED == "" ]]; then
fi
echo "user selected $SELECTED"
dms ipc call wallpaper set "$WP_DIR/$SELECTED/$(ls -1 "$WP_DIR/$SELECTED" | head -n 1)"
dms ipc call wallpaper set "$WP_DIR/$SELECTED/$(ls -1 "$WP_DIR/$SELECTED" | grep -v ".conf" | head -n 1)"
sleep 0.5
dms ipc call wallpaper next
dms ipc call wallpaper prev
## todo: add other settings
# fetch info from file
GenericColor=$(cat "$WP_DIR/$SELECTED/wallpaper.conf" | grep -e "Generic_Color:" | cut -d: -f2)
ThemeCategory=$(cat "$WP_DIR/$SELECTED/wallpaper.conf" | grep -e "Theme_Category:" | cut -d: -f2)
Matugen=$(cat "$WP_DIR/$SELECTED/wallpaper.conf" | grep -e "Matugen:" | cut -d: -f2)
Mode=$(cat "$WP_DIR/$SELECTED/wallpaper.conf" | grep -e "Mode:" | cut -d: -f2)
Preset=$(cat "$WP_DIR/$SELECTED/wallpaper.conf" | grep -e "Preset:" | cut -d: -f2)
echo "color: $GenericColor, category: $ThemeCategory, matugen: $Matugen, mode: $Mode, preset: $Preset"
# theme type (generic, auto, browse)
#generic is registry
dms ipc call settings set currentThemeCategory $ThemeCategory
# auto > matugen template
dms ipc call settings set matugenScheme scheme-$Matugen
# dark/light mode
dms ipc call theme $Mode
# generic > color
dms ipc call settings set currentThemeName $GenericColor
# browse > preset
dms ipc call settings set customThemeFile "/home/$(whoami)/.config/DankMaterialShell/themes/$Preset/theme.json"
sleep 0.5
dms kill
mmsg dispatch spawn_shell,dms run
sleep 4
dms ipc call theme toggle
dms ipc call theme toggle
dms ipc call theme $Mode
sleep 3
mmsg dispatch reload_config
notify-send "theme $SELECTED applied" "you may have to manually reload ghostty (ctrl+r)"
#read -n 1