aboutsummaryrefslogtreecommitdiffstats
path: root/copy.sh
diff options
context:
space:
mode:
authorJaƫl Champagne Gareau <gareau_jael@hotmail.com>2025-12-30 22:06:25 -0500
committerGitHub <noreply@github.com>2025-12-30 22:06:25 -0500
commitd05f22e5f4e92827ea69911cdd3dfc83c64c655c (patch)
treee06b351e620f54654e6562a2d95bd3e0a286ccc8 /copy.sh
parent330a934953fb79c56c60e2520210f8686b4c5459 (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-xcopy.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/copy.sh b/copy.sh
index 5b3d17cd..e925a698 100755
--- a/copy.sh
+++ b/copy.sh
@@ -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
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage