3

I'm running Ubuntu Gnome 14.10 64bit on my Lenovo Y500 laptop, and every time the system goes into suspend mode, the wallpaper turns into distorted colors like this or this and it's really annoying.

Do you have any idea what might be causing this?

Thanks.

Kmelkon
  • 213

1 Answers1

3

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
xandia
  • 31