diff options
Diffstat (limited to 'config/hypr/UserScripts')
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperAutoChange.sh | 2 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperEffects.sh | 4 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperRandom.sh | 4 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperSelect.sh | 13 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/WeatherWrap.sh | 6 |
5 files changed, 19 insertions, 10 deletions
diff --git a/config/hypr/UserScripts/WallpaperAutoChange.sh b/config/hypr/UserScripts/WallpaperAutoChange.sh index aa6cf89e..faec6335 100755 --- a/config/hypr/UserScripts/WallpaperAutoChange.sh +++ b/config/hypr/UserScripts/WallpaperAutoChange.sh @@ -27,7 +27,7 @@ if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then exit 1 fi -# Edit below to control the images transition +# Edit below to control the images transition (swww/awww) export SWWW_TRANSITION_FPS=60 export SWWW_TRANSITION_TYPE=simple diff --git a/config/hypr/UserScripts/WallpaperEffects.sh b/config/hypr/UserScripts/WallpaperEffects.sh index 57db3532..e1c8fe83 100755 --- a/config/hypr/UserScripts/WallpaperEffects.sh +++ b/config/hypr/UserScripts/WallpaperEffects.sh @@ -24,12 +24,12 @@ fi iDIR="$HOME/.config/swaync/images" iDIRi="$HOME/.config/swaync/icons" -# swww transition config (only when using swww) +# swww/awww transition config FPS=60 TYPE="wipe" DURATION=2 BEZIER=".43,1.19,1,.4" -if [[ "$WWW" == "swww" ]]; then +if [[ "$WWW" == "swww" || "$WWW" == "awww" ]]; then SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" else SWWW_PARAMS="" diff --git a/config/hypr/UserScripts/WallpaperRandom.sh b/config/hypr/UserScripts/WallpaperRandom.sh index db8251f2..70f051f7 100755 --- a/config/hypr/UserScripts/WallpaperRandom.sh +++ b/config/hypr/UserScripts/WallpaperRandom.sh @@ -19,12 +19,12 @@ PICS=($(find -L "${wallDIR}" -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]} -# Transition config (only when using swww) +# Transition config (swww/awww) FPS=30 TYPE="random" DURATION=1 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="" 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 diff --git a/config/hypr/UserScripts/WeatherWrap.sh b/config/hypr/UserScripts/WeatherWrap.sh index 1e15e4a6..a95bbd51 100755 --- a/config/hypr/UserScripts/WeatherWrap.sh +++ b/config/hypr/UserScripts/WeatherWrap.sh @@ -14,15 +14,15 @@ BASH_FALLBACK="$SCRIPT_DIR/Weather.sh" # Function to check network connectivity check_network() { # Try multiple methods to check network - if ping -c1 -W2 8.8.8.8 >/dev/null 2>&1; then + if ping -c1 -W1 8.8.8.8 >/dev/null 2>&1; then return 0 fi - if ping -c1 -W2 1.1.1.1 >/dev/null 2>&1; then + if ping -c1 -W1 1.1.1.1 >/dev/null 2>&1; then return 0 fi - if curl -s --connect-timeout 3 "https://ipinfo.io" >/dev/null 2>&1; then + if curl -s --connect-timeout 2 "https://ipinfo.io" >/dev/null 2>&1; then return 0 fi |
