4

So, due to an issue with gnome-power-manager, gnome-shell, and my nvidia card, I'm left in the awkward position of coming out of suspension/sleep with my graphics broken. This problem resolves itself if I'm able to use the Alt + F2 command line to restart gnome-shell. However, sometimes, I'm unable to actually access that menu, and I have to do it blindly with the broken graphics.

Rather than switching to the power-eating nouveau drivers, I thought I'd just try to replicate the functionality of

r

or

restart

in the Alt + F2 menu in a script and have it execute upon recovering from suspend.

Any advice/ideas? I don't really know where to start.

(Alternately, if you've got another workaround/solution..?)

edit: these guys are discussing the same problem: https://bbs.archlinux.org/viewtopic.php?pid=932527

2

assuming this is a single-user system, and assuming that a HUP signal is sufficient (causes gnome-shell to restart itself) You need to put a hook script containing something like

case "$1" in
  resume)
    killall -HUP gnome-shell
esac

into a pm-utils hook script, e.g /usr/lib/pm-utils/sleep.d/99hup-gnome-shell.

This will send a HUP signal to any gnome-shell instance running, and for a single user system there should only be one.

If HUP doesn't work, you could try TERM or KILL, and hope that your session manager starts up another one.

  • For some reason this works once, then resuming from suspend a second time kicks to login screen. – Ryan Ward Apr 12 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.