aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/UserScripts
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 /config/hypr/UserScripts
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 'config/hypr/UserScripts')
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperRandom.sh5
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperSelect.sh3
2 files changed, 5 insertions, 3 deletions
diff --git a/config/hypr/UserScripts/WallpaperRandom.sh b/config/hypr/UserScripts/WallpaperRandom.sh
index 654d4bd3..8dd680d5 100755
--- a/config/hypr/UserScripts/WallpaperRandom.sh
+++ b/config/hypr/UserScripts/WallpaperRandom.sh
@@ -2,12 +2,13 @@
# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ##
# Script for Random Wallpaper ( CTRL ALT W)
-wallDIR="$HOME/Pictures/wallpapers"
+PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")"
+wallDIR="$PICTURES_DIR/wallpapers"
SCRIPTSDIR="$HOME/.config/hypr/scripts"
focused_monitor=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name')
-PICS=($(find -L ${wallDIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.pnm" -o -name "*.tga" -o -name "*.tiff" -o -name "*.webp" -o -name "*.bmp" -o -name "*.farbfeld" -o -name "*.gif" \)))
+PICS=($(find -L "${wallDIR}" -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.pnm" -o -name "*.tga" -o -name "*.tiff" -o -name "*.webp" -o -name "*.bmp" -o -name "*.farbfeld" -o -name "*.gif" \)))
RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]}
diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh
index 0029d3e5..3fd3b858 100755
--- a/config/hypr/UserScripts/WallpaperSelect.sh
+++ b/config/hypr/UserScripts/WallpaperSelect.sh
@@ -4,7 +4,8 @@
# WALLPAPERS PATH
terminal=kitty
-wallDIR="$HOME/Pictures/wallpapers"
+PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")"
+wallDIR="$PICTURES_DIR/wallpapers"
SCRIPTSDIR="$HOME/.config/hypr/scripts"
wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current"
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage