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.


  • 1
    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. – Osqui 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.

  • 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. – Osqui Mar 5 '14 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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