Wallpaper turns into distorted pixels after suspend
After long time I found a rather practical workaround: The trick is to automatically reset the background upon resume.
To achieve this create a file "reset-bg-color.sh", for example in /opt/reset-bg/:
#!/bin/bash
gsettings set org.gnome.desktop.background primary-color '#000000'
gsettings set org.gnome.desktop.background secondary-color '#000000'
gsettings set org.gnome.desktop.background color-shading-type 'solid'
gsettings set org.gnome.desktop.background picture-uri ''
The second part is to register this script, so it will be invoked automatically when the computer resumes. In /lib/systemd/system-sleep place the second script file, in my case named "reset-bg.sh", including the following content:
#!/bin/bash
PROGNAME=$(basename "$0")
state=$1
action=$2
function log {
logger -i -t "$PROGNAME" "$*"
}
log "Running $action $state"
if [[ $state == post ]]; then
log "WAKE UP"
exec /opt/reset-bg/reset-bg-color.sh
fi
In case you prefer to have a wallpaper reloaded, instead of reset the background color, you can use the following file "reset-bg-wallpaper.sh":
#!/bin/bash
gsettings set org.gnome.desktop.background picture-uri "file:///home/alex/wallpaper/wallpaper-file.png"
and change the exec-statement in "reset-bg.sh" to the following:
exec /opt/reset-bg/reset-bg-wallpaper.sh