diff options
| author | Jaƫl Champagne Gareau <gareau_jael@hotmail.com> | 2025-12-30 22:06:25 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-30 22:06:25 -0500 |
| commit | d05f22e5f4e92827ea69911cdd3dfc83c64c655c (patch) | |
| tree | e06b351e620f54654e6562a2d95bd3e0a286ccc8 /copy.sh | |
| parent | 330a934953fb79c56c60e2520210f8686b4c5459 (diff) | |
fix: respect XDG dir instead of forcing ~/Pictures (#899)
* fix: respect XDG dir instead of forcing ~/Pictures
* fix: make xdg-user-dir usage more robust
---------
Co-authored-by: Donald Williams <129223418+dwilliam62@users.noreply.github.com>
Diffstat (limited to 'copy.sh')
| -rwxr-xr-x | copy.sh | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -1087,8 +1087,9 @@ fi printf "\n%.0s" {1..1} # wallpaper stuff -mkdir -p $HOME/Pictures/wallpapers -if cp -r wallpapers $HOME/Pictures/; then +PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")" +mkdir -p "$PICTURES_DIR/wallpapers" +if cp -r wallpapers "$PICTURES_DIR/"; then echo "${OK} Some ${MAGENTA}wallpapers${RESET} copied successfully!" | tee -a "$LOG" else echo "${ERROR} Failed to copy some ${YELLOW}wallpapers${RESET}" | tee -a "$LOG" @@ -1168,12 +1169,12 @@ while true; do echo "${OK} Wallpapers downloaded successfully." 2>&1 | tee -a "$LOG" # Check if wallpapers directory exists and create it if not - if [ ! -d "$HOME/Pictures/wallpapers" ]; then - mkdir -p "$HOME/Pictures/wallpapers" + if [ ! -d "$PICTURES_DIR/wallpapers" ]; then + mkdir -p "$PICTURES_DIR/wallpapers" echo "${OK} Created wallpapers directory." 2>&1 | tee -a "$LOG" fi - if cp -R Wallpaper-Bank/wallpapers/* "$HOME/Pictures/wallpapers/" >>"$LOG" 2>&1; then + if cp -R Wallpaper-Bank/wallpapers/* "$PICTURES_DIR/wallpapers/" >>"$LOG" 2>&1; then echo "${OK} Wallpapers copied successfully." 2>&1 | tee -a "$LOG" rm -rf Wallpaper-Bank 2>&1 # Remove cloned repository after copying wallpapers break |
