feat: cfg load
This commit is contained in:
parent
148c8938e9
commit
22e6573f27
@ -27,10 +27,12 @@ exec-once = swaync &
|
||||
exec-once = waybar & hyprpaper
|
||||
exec-once = hypridle
|
||||
exec-once = copyq --start-server
|
||||
|
||||
#Autostart programs
|
||||
exec-once = discord --start-minimized
|
||||
exec-once = steam -silent
|
||||
|
||||
exec-once = thunar --daemon
|
||||
#exec-once = thunar --daemon
|
||||
#exec-once = hyprpm reload -n
|
||||
|
||||
#############################
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
TARGET="$HOME/.saved_cfg"
|
||||
FOLDERS_FILE="$TARGET/folders"
|
||||
|
||||
if [[ ! -f "$FOLDERS_FILE" ]]; then
|
||||
echo "Error: $FOLDERS_FILE not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while IFS= read -r line || [[ -n "$line" ]]; do
|
||||
# Trim whitespace
|
||||
folder="$(echo "$line" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
|
||||
|
||||
# Skip empty lines and comments
|
||||
[[ -z "$folder" || "$folder" =~ ^# ]] && continue
|
||||
|
||||
SRC_PATH="$TARGET/$folder"
|
||||
DEST_PATH="$HOME/$folder"
|
||||
|
||||
if [[ -d "$SRC_PATH" ]]; then
|
||||
echo "Restoring $SRC_PATH -> $DEST_PATH"
|
||||
mkdir -p "$DEST_PATH"
|
||||
|
||||
rsync -av --delete --backup --backup-dir="$HOME/.cfg_restore_backup_$(date +%F_%T)" \
|
||||
--exclude='.git/' \
|
||||
"$SRC_PATH/" "$DEST_PATH/"
|
||||
else
|
||||
echo "Skipping $SRC_PATH (not found)"
|
||||
fi
|
||||
done < "$FOLDERS_FILE"
|
||||
|
||||
echo "Restore complete."
|
||||
Loading…
x
Reference in New Issue
Block a user