Sway: When setting a wallpaper image, the background switches to gray and then to the image

Created on 15 Feb 2019  路  9Comments  路  Source: swaywm/sway

Hi,

I wrote a utility for being able to set Timed Wallpapers (wallpaper slideshows, with crossfade between images) that also works for Wayland/Sway.

This works nicely, but when the wallpaper is changed, the background blinks by first switching to gray and then to the selected image.

Steps to reproduce:

  1. Install the Mojave timed wallpaper, either from GitHub or from the AUR package named gnome-mojave-timed-wallpaper (if you use Arch Linux).
  2. Install wallutils, either from GitHub or from the Arch Linux package named wallutils (if you use Arch Linux).
  3. Run this command settimed mojave-timed.

Then just wait a bit, and the background will blink every few minutes.

The command being run for setting the wallpaper looks like this:

swaymsg 'output "*" background /usr/share/backgrounds/gnome/mojave/mojave_dynamic-1320.jpg fill'

This is a feature request for the background image to be switched smoothly, without the background blinking.

I'm using sway version 1.0-beta.1-245-gdbf8e1ce (Nov 27 2018, branch 'master') and have also tested with the latest master of sway (which fixes the problem with the windows blinking too).

Thanks for creating Sway!

enhancement

Most helpful comment

+1 very annoying while using pscircle

All 9 comments

This would require to stop killing swaybg, and replace it with some kind of IPC.

If we're feeling spicy we could wait for the new swaybg instance to come up before killing the old one. The z-ordering should place it on top

I tried swapping things around so that the old swaybg client is destroyed after a new one is forked, but that still leaves some blanking.

I also discovered that sway gets rather upset if apply_output_config hangs (everything freezes until apply_output_config is done), so I'm not sure how good an idea it is to wait for swaybg for this use-case鈥攊t'll be rather annoying if sway hangs a brief moment every time wallutils swaps the background. It'll mess with fast typing. I at least concluded that my sleep(1) hack was a terrible idea. :)

I could create a thread to kill swaybg in the background, but everything is starting to feel a bit hacky. If only I could write go func() { ... }...

+1 very annoying while using pscircle

Hello,

I would like to implement an IPC feature (on both sides), is there some work in process?

I don't think so. It's still not clear to me whether we want an IPC for swaybg.

Okay, fair enough.
But I think it would be pretty cool to change the background without having 1/2 seconds a grey background. What are the alternatives?

Alternate background providers such as https://github.com/vilhalmer/oguri intends to be more fully-featured.

I want to change my wallpaper via swaybg every 5 minutes without the gray pause.

Thanks in advance for your help and for everything you do in Sway.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

emersion picture emersion  路  4Comments

StephenBrown2 picture StephenBrown2  路  4Comments

johanhelsing picture johanhelsing  路  3Comments

cauebs picture cauebs  路  3Comments

mcmfb picture mcmfb  路  3Comments