forked from Maciejonos/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-config
More file actions
executable file
·55 lines (45 loc) · 1.57 KB
/
setup-config
File metadata and controls
executable file
·55 lines (45 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
set -e
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
source "$SCRIPT_DIR/lib/helpers.sh"
source "$SCRIPT_DIR/lib/backup.sh"
DOTFILES_DIR="$HOME/.local/share/dotfiles"
log_info "Backing up existing config..."
# Collect all targets that will be affected
TARGETS=()
for item in "$DOTFILES_DIR/config"/*; do
if [ -e "$item" ]; then
item_name=$(basename "$item")
TARGETS+=("$HOME/.config/$item_name")
fi
done
for target in "${TARGETS[@]}"; do
if [ -e "$target" ]; then
backup_file "$target" || {
log_error "Failed to backup $(basename "$target")"
exit 1
}
fi
done
for target in "${TARGETS[@]}"; do
remove_path "$target"
done
cp -r "$DOTFILES_DIR/config/"* "$HOME/.config/"
log_success "Config copied!"
echo "@import url(\"file://$HOME/.local/share/dotfiles/current/theme/gtk.css\");" >"$HOME/.config/gtk-3.0/gtk.css"
echo "@import url(\"file://$HOME/.local/share/dotfiles/current/theme/gtk.css\");" >"$HOME/.config/gtk-4.0/gtk.css"
mkdir -p "$HOME/.config/tinte"
[ -f "$HOME/.config/tinte/settings.json" ] && rm -f "$HOME/.config/tinte/settings.json"
cat > "$HOME/.config/tinte/settings.json" << EOF
{
"wallpaperFolder": "$HOME/Pictures/dotfiles-wallpapers",
"posthookScript": "theme-set",
"exportThemeLocation": "$HOME/.config/tinte/exported-themes",
"applyThemeLocation": "$HOME/.local/share/dotfiles/themes/tinte",
"colorBackend": "imagemagick",
"wallpaperBackend": "hyprpaper"
}
EOF
log_success "Config copied!"
log_info "Backup saved to: $BACKUP_DIR"
log_info "Restore instructions: cat $RESTORE_FILE"