···110110111111# Theme and background
112112unbind = SUPER, T
113113-bindd = SUPER, T, Pick new theme, exec, omarchy-menu theme
113113+bindd = SUPER, T, Pick new theme, exec, ~/.config/hypr/sspaeti/omarchy-menu-wrapper theme
114114#toggle to my personal background images
115115bind = SUPER ALT, T, exec, ~/.config/hypr/sspaeti/bg-mode-toggle.sh switch
116116bind = SUPER ALT SHIFT, T, exec, ~/.config/hypr/sspaeti/bg-mode-toggle.sh next
+36
hypr/.config/hypr/sspaeti/omarchy-menu-wrapper
···11+#!/bin/bash
22+33+# Wrapper for omarchy-menu that preserves personal backgrounds when switching themes
44+# This script calls the original omarchy-menu and then restores personal background if needed
55+66+STATE_FILE="$HOME/.config/hypr/sspaeti/.bg_mode_state"
77+CURRENT_IMAGE_FILE="$HOME/.config/hypr/sspaeti/.current_personal_image"
88+99+# Check if we need to restore personal background after theme change
1010+should_restore=false
1111+if [ -f "$STATE_FILE" ]; then
1212+ current_mode=$(cat "$STATE_FILE")
1313+ if [ "$current_mode" = "personal" ] && [ -f "$CURRENT_IMAGE_FILE" ]; then
1414+ should_restore=true
1515+ image_path=$(cat "$CURRENT_IMAGE_FILE")
1616+ fi
1717+fi
1818+1919+# Call the original omarchy-menu with all arguments passed through
2020+~/.local/share/omarchy/bin/omarchy-menu "$@"
2121+2222+# Post-processing: Restore personal background if needed
2323+if [ "$should_restore" = true ] && [ -f "$image_path" ]; then
2424+ # Background restore happens asynchronously to avoid blocking
2525+ {
2626+ # Wait briefly for swaybg to be killed and restarted by theme change
2727+ sleep 0.15
2828+2929+ # Start new swaybg with personal image
3030+ swaybg -i "$image_path" &
3131+ sleep 0.05
3232+3333+ # Kill the old swaybg (from theme change)
3434+ pkill -o swaybg
3535+ } &
3636+fi