Running X window programs from PM suspend-resume scripts

Chris Tyler chris at tylers.info
Mon Mar 22 19:56:46 UTC 2010


On Mon, 2010-03-22 at 21:10 +0200, Serguei Miridonov wrote:
> Hello,
> 
> Is there a trick to run X window programs from PM suspend-resume 
> hooks? For example, I need to restore keyboard mapping after suspend 
> to RAM using 
> 
> xkbcomp some_file.xkm :0.0
> 
> Running this in
> 
> #!/bin/bash
> DISPLAY=":0.0"
> export DISPLAY
> case $1 in
>     hibernate | suspend)
> 	;;
>     thaw | resume)
>         sleep 2
> 	chvt 1
> 	sleep 1
> 	xkbcomp /home/mirsev/GoodKeyMap.xkm $DISPLAY
> 	;;
>     *)
>         ;;
> esac
> exit 0
> 
> gives an error: Cannot open display ":0.0"
> 
> Any idea?

Sounds like a problem with auth. Try setting the XAUTHORITY environment
variable, perhaps?

-Chris



More information about the users mailing list