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
  • Do you know what video driver you use? (Software Center > Edit (menu) > Software Sources > Extra Drivers (tab) – Jacob Vlijm Apr 06 '15 at 07:18
  • yeah I use nvidia binary driver - version 331.113 from nvidia-331 (proprietary, tested) – Kmelkon Apr 06 '15 at 07:29
  • Not a "quality answer", but it might help nevertheless:: often in these occasions, switching to another driver makes a difference. – Jacob Vlijm Apr 06 '15 at 07:35
  • sorry, but this is what was written in the tab you mentioned, should I use some other command that will give all the info? if so please tell me what is it? if it's related to gpu, maybe I have to update the driver? – Kmelkon Apr 06 '15 at 07:41
  • doesn't it offer different options like this https://dl.dropboxusercontent.com/u/1155139/drivers.png ? – Jacob Vlijm Apr 06 '15 at 07:47
  • oh yes, like this http://imgur.com/bpXk4pZ – Kmelkon Apr 06 '15 at 07:52
  • Exactly. You could try one of the others. Occasional minor bugs or incompatibilities occur, changing to another driver often solves the problem. – Jacob Vlijm Apr 06 '15 at 07:57
  • Just curious, but did you try :) – Jacob Vlijm Apr 06 '15 at 08:46
  • sorry, but I haven't, I'd like to use the proprietary driver and usually when I use the other drivers I get more severe problems, like UI disappearing, there's an update to the driver I'm using but I don't know how to install it. – Kmelkon Apr 06 '15 at 08:59
  • I've encountered numerous problems with suspend, so I try not to use it for that reason. I realize that may not fix your problem but it may make you feel better if you discover there isn't a solution. – gyropyge Apr 06 '15 at 08:36
  • haha damn, that's a relief I guess, I'll just stop using it then. – Kmelkon Apr 06 '15 at 08:57
  • I truly appreciate your understanding my good intent. There may be a solution, and if so, I look forward to hearing it. Come to think of it, I'm going to star your question so that if it is ever solved, I'll learn from it. – gyropyge Apr 06 '15 at 09:00
  • PS: I should probably add that one of the major improvements in Ubuntu in the past three years or so has been exemplary bootup and shutdown times. Suspend is much more important with the slowness of windows computers. Here's another tip. If you tap the power button, (do not hold it down) it brings up a shutdown dialogue. Pressing enter shuts down the computer properly and quickly. – gyropyge Apr 06 '15 at 09:02
  • 1
    Thanks for your tips, the thing is on every bootup, the process gets delayed by a bug in the gpu for like 30 seconds, it writes something about broken pipe and sanity check, then it fixes itself and boot. If this didn't exist I'd probably never suspend, as you said bootup and shutdown times are really low now. – Kmelkon Apr 06 '15 at 09:16
  • This solution works it for me: https://askubuntu.com/a/1454105/28997 – Narcélio Filho Feb 08 '23 at 18:03

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
  • Didn't worked for me, on Gnome 3.30. I think you need to change some keys to it really take effect, like first setting primary-color '#000001' and then setting primary-color '#000000' afterwards. – Narcélio Filho Feb 08 '23 at 18:05