aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/UserScripts/WallpaperSelect.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/hypr/UserScripts/WallpaperSelect.sh')
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperSelect.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh
index 9dafdf57..31c7969a 100755
--- a/config/hypr/UserScripts/WallpaperSelect.sh
+++ b/config/hypr/UserScripts/WallpaperSelect.sh
@@ -21,17 +21,18 @@ wallpaper_link="$HOME/.config/rofi/.current_wallpaper"
iDIR="$HOME/.config/swaync/images"
iDIRi="$HOME/.config/swaync/icons"
-# swww transition config (only when using swww)
+# swww/awww transition config
FPS=60
TYPE="any"
DURATION=2
BEZIER=".43,1.19,1,.4"
-if [[ "$WWW_CMD" == "swww" ]]; then
+if [[ "$WWW_CMD" == "swww" || "$WWW_CMD" == "awww" ]]; then
SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER"
else
SWWW_PARAMS=""
fi
+
# Check if package bc exists
if ! command -v bc &>/dev/null; then
notify-send -i "$iDIR/error.png" "bc missing" "Install package bc first"
@@ -42,6 +43,9 @@ fi
rofi_theme="$HOME/.config/rofi/config-wallpaper.rasi"
focused_monitor=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name')
+per_monitor_wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current_${focused_monitor}"
+per_monitor_wallpaper_link="$HOME/.config/rofi/.current_wallpaper_${focused_monitor}"
+
# Ensure focused_monitor is detected
if [[ -z "$focused_monitor" ]]; then
notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Could not detect focused monitor"
@@ -175,6 +179,11 @@ apply_image_wallpaper() {
}
"$WWW_CMD" img -o "$focused_monitor" "$image_path" $SWWW_PARAMS
+ # Persist per-monitor wallpaper selection
+ mkdir -p "$(dirname "$per_monitor_wallpaper_current")" "$(dirname "$per_monitor_wallpaper_link")"
+ ln -sf "$image_path" "$per_monitor_wallpaper_link" || true
+ cp -f "$image_path" "$per_monitor_wallpaper_current" || true
+
# Run additional scripts (pass the image path to avoid cache race conditions)
"$SCRIPTSDIR/WallustSwww.sh" "$image_path"
sleep 2
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage