Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] running an X program from a daemon script



On Dec.29 13h57, Stephen J. Turnbull wrote :
> >>>>> "Evan" == Evan Monroig <evan.monroig@example.com> writes:
>     Evan> I tried to set up the environmental variable DISPLAY to :0,
>     Evan> and also XAUTHORITY to ~/.Xauthority,
> 
> The daemon is not running as you (or it would just work).  So "~"
> doesn't mean your home directory, and it may not even mean an existing
> directory.  Try the "~evan" syntax (but it needs to be done in a
> context where the shell will interpret the "~", that's not a libc or
> kernel function IIRC).  Alternatively, man xauth, and export the perms
> to a file the daemon (and only the daemon) can read.

Thanks for your help :). I didn't know we could use '~user'..

In order to try all this I made a small script called /tmp/test.sh, and 
set up a cron job to have root launch it in one minute.
After a few tries, I found the script worked when it had these contents
----
#!/bin/sh
echo "launched" >> /tmp/test.log
su evan -c "GTK_IM_MODULE=uim DISPLAY=:0 XAUTHORITY=/tmp/.gdmorTQs8 \
/usr/bin/ssh-askpass Encrypted File System cryptkey" >> /tmp/test.log
----

There are still a few things that I don't understand:

First, my XAUTHORITY is not /home/evan/.Xauthority but /tmp/.gdmorTQs8 
There *is* a file /home/evan/.Xauthority but it is owned by root (maybe 
remaining from my configuration attemps). I will try to remove it and 
log out and log in again when I can.

Second, when I don't set the GTK_IM_MODULE environmental variable, it 
doesn't work and in /tmp/test.log I have the following line:

Launching a SCIM daemon with Socket FrontEnd...

This seems to be linked to the japanese langage configuration.

Evan

Attachment: signature.asc
Description: Digital signature


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links