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

Bug#695140: Xsession: please wrap around $STARTUP to allow launching other processes



Package: x11-common
Severity: wishlist

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hello,

With its current design, Xsession builds a long $STARTUP command line in
the different scripts present in /etc/X11/Xsession.d/, and finally runs
it from /etc/X11/Xsession.d/99x11-common_start.

This is appropriate for agents such as ssh-agent or gpg-agent, that are
used in a mode where they act as wrappers around the command they are
given as argument, for instance:
    gpg-agent --daemon dbus-launch --exit-with-session ~/.xsession

This design, however, can cause problems with programs that are not
designed with such a wrapper mode. For instance, to launch xbindkeys or
xmodmap from Xsession, we have to do:
    xmodmap &
    xbindkeys &
    gpg-agent --daemon dbus-launch --exit-with-session ~/.xsession

As indicated in bug #659406, this is problematic for xbindkeys, which is
meant to launch commands: when launched this way, it does not have the
environment variables that would be set by the different agents, and
thus the commands it launches inherit from a reduced environment.

I think it would be more flexible to
1. modify /etc/X11/Xsession.d/50x11-common_determine-startup so that it
   defines:
       $STARTUP=/etc/X11/Xsession.start
       $XSESSION=$USERXSESSION or $ALTUSERXSESSION or …
   star;
2. to write a wrapper shell script /etc/X11/Xsession.start to launch the
   eventual additional programs and the final session:
       #!/bin/sh
       eval $OTHERPROGRAMS
       exec $XSESSION
3. let /etc/X11/Xsession.d/99x11-common_start start, not the final
   session as it currently does, but this wrapper script:
       exec $STARTUP
   (yes, nothing to be changed here, only the content of $STARTUP would
   be different)

This way, scripts from packages such as xbindkeys could simply add
commands to $OTHERPROGRAMS and expect to be run in the regular
session environment.

- -- 
 ,--.
: /` )   Tanguy Ortolo      <xmpp:tanguy@ortolo.eu>
| `-'    Debian Developer   <irc://irc.oftc.net/Tanguy>
 \_

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBCgAGBQJQvhR0AAoJEOryzVHFAGgZZs0QAMaJh3uN6lr77m3OiyUWMnFu
HJ0D8em8djIo0MMazLNAJCEBF9hY/tUmvuudvBr82t2WLgZ/f2/MF3zXanSHEAFt
a5czbVVwU98XOVtv1ErvCRLx0hdT0aM5fN5s+CukUuffHb1kSEZYpVA9nNMsZtMe
yhY4fx4x3n8fyO7f8iDu0M7XVU/zpSkT3x3Sxdfwsg2sVySyzr4UEAcV/QzkvDxK
5MP//6GqUpRrIgIMBauTyZ5Ufs45aisLek29ik0njKxn7yr7VzLykdDpw0mDF2/S
fJslucM03X1/TCboXAA6k5iQGxsIFS4Me4I+LznvKzQeK6uypm4AaldQt2uVd9v8
0exs2Vj2UmD5d57eqf+rVrfJW+V7aI7sMH3y4rQoTSCd4DnyoYLe97fAF5R5ITtp
mCeEyRnHuM2BdyK+NUKWEFQhgHU0dJ2qr5GTQQqp0L4WK/QCtBgHDRUTprjvnb2x
UJQvFr/+Hmz1fnqTX8AVwZbpp/GdPgb4Ow0YbI7LD7xz4Aa+7Gb0CjlrAZSpG0wn
+5GTQHBfURsNnAvwTOXvpdWQcX0bqWu2YnXq8I3t8iQBgKEDciYmES6ZAGLLLrCD
7IpHrhTnO7JcipxcrMLJHGRDNH9NAXLVy2x09R9gVMgY185Sijmk9REJCDJ0/Xy0
oIoEUX2U0DDuYM0UphPK
=+ft1
-----END PGP SIGNATURE-----


Reply to: