Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wallpaper not updating on the second monitor #350

Open
AlexAuragan opened this issue Aug 8, 2024 · 4 comments
Open

Wallpaper not updating on the second monitor #350

AlexAuragan opened this issue Aug 8, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@AlexAuragan
Copy link

AlexAuragan commented Aug 8, 2024

Bug description

Swww works fine on my primary monitor, but not on the second one. When I call swww on the second monitor I get no error. In fact, when I do swww query I even get the correct wallpaper, but the image is not updated untill I restart my laptop

setup

ubuntu 24 lts, hyprland installed with the help of JaKooLit's repo

@LGFae
Copy link
Owner

LGFae commented Aug 12, 2024

Are you on the latest git version?

And, are your monitors at different resolutions?

@LGFae LGFae added the bug Something isn't working label Aug 12, 2024
@xsghetti
Copy link

xsghetti commented Aug 15, 2024

I also have this issue. Switching to -git made it not work at all.

Edit -
After swithing to -git and using waypaper it works. I think it may have something to do with JaKooLit's wallpaper changer script because i also utilize that but not his full dotfiles.

Edit 2 - After changing the wallpaper with waypaper, and then trying the wallpaper script again, it works.
Strange work around lol.

Upon relogging, waypaper had to be loaded to make the wallpaper change script work again.
Wallpaper select script posted below.


scriptsDir="$HOME/.config/hypr/scripts"

# WALLPAPERS PATH
wallDIR="$HOME/.config/wallpapers"

# Transition config
FPS=60
TYPE="wipe"
DURATION=2
BEZIER=".43,1.19,1,.4"
SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION"

# Check if swaybg is running
if pidof swaybg > /dev/null; then
  pkill swaybg
fi

# Retrieve image files
PICS=($(ls "${wallDIR}" | grep -E ".jpg$|.jpeg$|.png$|.gif$"))
RANDOM_PIC="${PICS[$((RANDOM % ${#PICS[@]}))]}"
RANDOM_PIC_NAME="${#PICS[@]}. random"

# Rofi command
rofi_command="rofi -show -dmenu -theme $HOME/.config/rofi/themes/wallpaper-select.rasi"

menu() {
  for i in "${!PICS[@]}"; do
    # Displaying .gif to indicate animated images
    if [[ -z $(echo "${PICS[$i]}" | grep .gif$) ]]; then
      printf "$(echo "${PICS[$i]}" | cut -d. -f1)\x00icon\x1f${wallDIR}/${PICS[$i]}\n"
    else
      printf "${PICS[$i]}\n"
    fi
  done

  printf "$RANDOM_PIC_NAME\n"
}

swww query || swww init

main() {
  choice=$(menu | ${rofi_command})

  # No choice case
  if [[ -z $choice ]]; then
    exit 0
  fi

  # Random choice case
  if [ "$choice" = "$RANDOM_PIC_NAME" ]; then
    swww img "${wallDIR}/${RANDOM_PIC}" $SWWW_PARAMS
    exit 0
  fi

  # Find the index of the selected file
  pic_index=-1
  for i in "${!PICS[@]}"; do
    filename=$(basename "${PICS[$i]}")
    if [[ "$filename" == "$choice"* ]]; then
      pic_index=$i
      break
    fi
  done

  if [[ $pic_index -ne -1 ]]; then
    swww img "${wallDIR}/${PICS[$pic_index]}" $SWWW_PARAMS
  else
    echo "Image not found."
    exit 1
  fi
}

# Check if rofi is already running
if pidof rofi > /dev/null; then
  pkill rofi
  exit 0
fi

main

wal -i ~/.config/rofi/.current_wallpaper

~/.config/hypr/scripts/swww.sh

_ps=(waybar)
for _prs in "${_ps[@]}"; do
    if pidof "${_prs}" >/dev/null; then
        pkill "${_prs}"
    fi
done

sleep 1
# Relaunch waybar
waybar &

~/.config/hypr/scripts/refresh.sh

pywal-discord```

@AlexAuragan
Copy link
Author

AlexAuragan commented Aug 21, 2024

Sorry I was on vacation.
Yes I just rebuilt from git and I still have the same issue, also yes the two monitors are different sizes

If that helps:

xrandr --query


Screen 0: minimum 16 x 16, current 3520 x 1080, maximum 32767 x 32767
eDP-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 380mm x 220mm
   1920x1080     59.96*+
   1440x1080     59.99  
   1400x1050     59.98  
   1280x1024     59.89  
   1280x960      59.94  
   1152x864      59.96  
   1024x768      59.92  
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   1680x1050     59.95  
   1440x900      59.89  
   1280x800      59.81  
   1152x720      59.97  
   960x600       59.96  
   928x580       59.88  
   800x500       59.50  
   768x480       59.90  
   720x480       59.71  
   640x400       59.95  
   320x200       58.96  
   1600x900      59.95  
   1368x768      59.88  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.55  
   640x350       59.77  
HDMI-A-1 connected 1600x900+1920+0 (normal left inverted right x axis y axis) 440mm x 250mm
   1600x900      59.95*+
   1152x864      59.96  
   1024x768      59.92  
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   1440x900      59.89  
   1280x800      59.81  
   1152x720      59.97  
   960x600       59.63  
   928x580       59.88  
   800x500       59.50  
   768x480       59.90  
   720x480       59.71  
   640x400       59.95  
   320x200       58.96  
   1368x768      59.88  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.55  
   640x350       59.77  

edit: I just tried @xsghetti's solution and it worked like once for me, then it's not working again, it's not a reliable workaround on my setup.

@xsghetti
Copy link

xsghetti commented Dec 5, 2024

This error is occurring again with the vertical monitor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants