Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to change the wallpaper when a custom .deb package is installed.

In the postinst script I've written this:

PID=$(pgrep gnome-session)

export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ | cut -d= -f2- )

dbus-launch gsettings set org.gnome.destkop.backgroun picture-uri “file:///path/photo.png”

I see dconf value is changed, but nothing else happens (wallpapers isn't changed), although my photo appears as the current wallpaper in "gnome-control-center background" . (wtf!!??).

Moreover, when I logout and login again, the former dconf value returns as if I hadn't done anything.

I'm going crazy.


share|improve this question
A .deb package is not meant to change user specific configuration settings. – chaos Mar 5 '14 at 11:57
You're right, but I simply would know why gsettings doesn't reach to execute completely in postinst script (it changes dconf value but it isn't permanent between logins and never reflected on display) whilst in another regular script it just works. – Paco Porras Mar 5 '14 at 13:30

could it be that you oversee the fact that a .deb installer (and thus the postinst script) run from root? wallpapers are set on user level.

What you are actually trying to do is give the user "root" a nice wallpaper.

share|improve this answer
Thanks for you comments. I thought the same so I tried writing su -l myuser -c "dbus-launch gsettings....", but without luck. I believed specifying the value of DBUS_xxx variable for the current session would do gsettings command affect to current user...but I'm not sure. – Paco Porras Mar 5 '14 at 13:22

Your Answer


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.