Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

Thanks!

share|improve this question
1  
A .deb package is not meant to change user specific configuration settings. –  chaos Mar 5 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 at 13:30

1 Answer 1

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 at 13:22

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.