Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

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.

share|improve this answer
    
This seems to work for me! Thanks. –  dpimka Jun 7 '11 at 11:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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