Thaw/Resume from Sleep programs

Following some direction I’ve received previously, and the SMB documentation on waking from sleep, I’ve created a file /etc/pm/sleep.d/33tsa with a script in it to reboot programs that seem to die when I enter sleep mode. I think the PulseAudio and the Synaptik seem to be working, but this doesn’t seem to be working for my xmodmaprc, which is an important keyboard rebind that I use. I still end up re-running it manually every time I wake up. Yes, this is executable. Can anyone give me suggestions on why I can’t get xmodmap to stick? I also have it on boot, and it starts fine in that context (if only it would stay through sleep).


 #!/bin/bash -x
case $1 in
    thaw|resume)
      xmodmap /home/ME/.xmodmaprc
      pavucontrol
      synaptiks
        ;;
esac

Thanks!

openSUSE 12.2 x 64, KDE 4

Because PM scripts are executed in system context and have no idea which to which X server (which user session) these commands should apply.

Oh. Thanks. What can I do to relaunch these things?

Brute force way is to export DISPLAY variable. And do not forget, you need to run these scripts as your own user, not as root. See example here: https://bbs.archlinux.org/viewtopic.php?id=88369

I am not aware of any way to hook into “resume from suspend” in KDE (or Gnome for that matter) inside of user session.

On 2012-12-26 22:56, WorldsEndless wrote:
> but this doesn’t seem to be working for my
> xmodmaprc

Check the log for that script, or create log entries yourself.


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))