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

Re: Complaints from mousepad.



Hello Peter,

peter@easthope.ca writes:

[...]
>   0) mousepad --display=:0 /home/me/a & ;;
[...]
> (mousepad:8747): dconf-WARNING **: 06:30:53.773: failed to commit 
> changes to dco nf: Cannot autolaunch D-Bus without X11 $DISPLAY
>
> How should the shell function or mousepad notify dconf that the 
> display is :0?

Have you tried setting the DISPLAY environment variable like the warning
mentions? That's the standard mechanism for X11 applications to know
which server to connect to.

Alternatively you might want to either start a D-Bus session explicitly
(using e.g. dbus-run-session) or connect to an existing D-Bus session
bus by extracting DBUS_SESSION_BUS_ADDRESS from the environment that has
a running D-Bus session and setting it in the environment where you want
to run mousepad. Which solution is better depends on which applications
you want to be able to talk to each other.

For example you could place this in your .xsession:

echo export DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS}" > ~/.dbusaddr

And then in your met() function:

( source ~/.dbusaddr && exec mousepad --display=:0 /home/me/a ) &

The subshell ensures only mousepad sees
DBUS_SESSION_BUS_ADDRESS. Otherwise you'd get different behaviour from
various applications based on exactly when you started your editor. If
you want all applications to access this session bus, place "source
~/.dbusaddr" somewhere else. Just be careful where you place it; you
might end up overriding the address of the new session bus when you
start your X11 session.

Sascha

Attachment: signature.asc
Description: PGP signature


Reply to: