[Debian-eeepc-devel] Bug#471521: vga-toggle.sh: does not do XAUTHORITY dance

Damyan Ivanov dmn at debian.org
Wed Mar 19 14:50:49 UTC 2008


I've found a case when the notify() sub guesses the XAUTHORITY stuff
wrongly and as a result no notifications appear.

Here's how the output of `who' is when I am logged in my Gnome session
and there is one open gnome-terminal:

  dam   tty7        2008-03-19 13:40 (:0)
  dam   pts/2       2008-03-19 16:21 (:0.0)

If I also run the 'gnome terminal as root' menu item, `who' guves:

  dam   tty7        2008-03-19 13:40 (:0)
  root  pts/1       2008-03-19 16:33 (:0.0)
  dam   pts/2       2008-03-19 16:21 (:0.0)

For some reason, the sed magic considers the 'root' session as the real
one and sets XAUTHORITY to /home/root/.Xauthority.

Ah, could it be the bad home directory? root's HOME is /root!

Changing the code to
  home=`getent passwd $user | cut -d: -f6`
  XAUTHORITY=$home/.Xauthority
guesses the home directory OK, but still can't display the notification,
as the root session is using another file --
/tmp/libgksu-$random/.Xauthority

Doh!

Still, I think that the change to notify() that guesses user's home
directory from getent is useful.

Also, how do you feel about sending notifications to *all* available X
sessions? My sed-foo is not high enough for this, but I can create some
grep/cut or awk thing...

-- 
dam            JabberID: dam at jabber.minus273.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/debian-eeepc-devel/attachments/20080319/ed813a18/attachment.pgp 


More information about the Debian-eeepc-devel mailing list