diff options
| author | Don Williams <don.e.williams@gmail.com> | 2025-11-25 23:30:17 -0500 |
|---|---|---|
| committer | Don Williams <don.e.williams@gmail.com> | 2025-11-25 23:30:17 -0500 |
| commit | 7829491f93424b237f74ed0ba3cbfcbe56294c1e (patch) | |
| tree | 65d92b593dcc82989619b20026a63ddb8a3c7f01 /config/hypr/scripts/UserConfigsSwitcher.sh | |
| parent | e0141281bee6d15904e9d21cc1c665db1e3f34a0 (diff) | |
| parent | c575e0672a6a3f7f7e841c9b2ba6b2a97fb4c53f (diff) | |
Merge br-userconfigs: Resolve conflict - remove WindowRules-v3.conf
Diffstat (limited to 'config/hypr/scripts/UserConfigsSwitcher.sh')
| -rwxr-xr-x | config/hypr/scripts/UserConfigsSwitcher.sh | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/config/hypr/scripts/UserConfigsSwitcher.sh b/config/hypr/scripts/UserConfigsSwitcher.sh new file mode 100755 index 00000000..ad1d4e63 --- /dev/null +++ b/config/hypr/scripts/UserConfigsSwitcher.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# Script to manage UserConfigs and UserConfigsBak + +HYPR_CONFIG_DIR="$HOME/.config/hypr" +USER_CONFIGS="$HYPR_CONFIG_DIR/UserConfigs" +USER_CONFIGS_BAK="$HYPR_CONFIG_DIR/UserConfigsBak" + +if [ -d "$USER_CONFIGS" ] && [ ! -d "$USER_CONFIGS_BAK" ]; then + echo "Moving UserConfigs to UserConfigsBak..." + mv "$USER_CONFIGS" "$USER_CONFIGS_BAK" + echo "Done. Your UserConfigs are now in UserConfigsBak." +elif [ ! -d "$USER_CONFIGS" ] && [ -d "$USER_CONFIGS_BAK" ]; then + echo "Moving UserConfigsBak to UserConfigs..." + mv "$USER_CONFIGS_BAK" "$USER_CONFIGS" + echo "Done. Your backup has been restored to UserConfigs." +elif [ -d "$USER_CONFIGS" ] && [ -d "$USER_CONFIGS_BAK" ]; then + echo "Both UserConfigs and UserConfigsBak exist." + echo "Please choose what to do:" + PS3="Enter your choice: " + select option in "Backup current UserConfigs (move to UserConfigsBak)" "Restore backup (move UserConfigsBak to UserConfigs)" "Swap them" "Do nothing"; do + case $REPLY in + 1) + echo "Backing up UserConfigs..." + rm -rf "$USER_CONFIGS_BAK" + mv "$USER_CONFIGS" "$USER_CONFIGS_BAK" + echo "Done. UserConfigs moved to UserConfigsBak." + break + ;; + 2) + echo "Restoring backup..." + rm -rf "$USER_CONFIGS" + mv "$USER_CONFIGS_BAK" "$USER_CONFIGS" + echo "Done. UserConfigsBak moved to UserConfigs." + break + ;; + 3) + echo "Swapping..." + mv "$USER_CONFIGS" "$HYPR_CONFIG_DIR/UserConfigs.tmp" + mv "$USER_CONFIGS_BAK" "$USER_CONFIGS" + mv "$HYPR_CONFIG_DIR/UserConfigs.tmp" "$USER_CONFIGS_BAK" + echo "Done. UserConfigs and UserConfigsBak have been swapped." + break + ;; + 4) + echo "No changes made." + break + ;; + *) + echo "Invalid option. Please try again." + ;; + esac + done +else + echo "Neither UserConfigs nor UserConfigsBak directory found. Nothing to do." +fi |
