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.

share|improve this question
    
I think the dbus-launch may have something to do with it. – Bharadwaj Raju Mar 27 '16 at 12:00
    
Actually that has no effect on the tmux shell. But thanks for reminding me of this question! – zrneely Mar 28 '16 at 17:44
up vote 2 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.