3

I'm trying to change various dconf settings with gsettings. For some reason, it only works when I'm not in tmux. I can read settings within tmux, but setting them fails silently - it appears to work, but the change doesn't have an effect and reading again gives the old value back. Outside of tmux, everything works perfectly - I can read and set dconf properties, and they take effect immediately. Here's the relevant part of my bashrc:

# start tmux
if command -v tmux >/dev/null; then
    [[ ! $TERM =~ screen ]] && [ -z "$TMUX" ] && exec tmux
    # in tmux, we need to handle dbus specially
    export $(dbus-launch)
fi

I have no problems starting X-based applications from within tmux. For reference, I have Ubuntu 15.04 and I'm using Gnome Shell instead of Unity.

2
  • I think the dbus-launch may have something to do with it.
    – user423626
    Mar 27, 2016 at 12:00
  • Actually that has no effect on the tmux shell. But thanks for reminding me of this question!
    – zrneely
    Mar 28, 2016 at 17:44

1 Answer 1

1

I managed to solve this problem (finally, and with the help of some people on the #linux freenode irc channel). One issue was that dbus-launch does not affect tmux at all; it affects the outer shell only. The solution was to put this in my .tmux.conf:

set-option -g -a update-environment " DBUS_SESSION_BUS_ADDRESS"

which allowed applications started within tmux to access the system bus.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .