Xfce Forum

Sub domains
 

You are not logged in.

#1 2013-07-15 03:28:23

Mish
Member
Registered: 2013-07-14
Posts: 3

Cannot change desktop background using command line

Hello Folks,

I seem to be having a  slight problem with desktop backgrounds....

I'm using

XFCE 4.10
Ubuntu Studio 12.04.2


I can change the Desktop background just fine using the GUI. But when try changing it in terminal using

xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s <name>

it doesn't work. Tried both with and without file extensions. Instead of changing the background to what I want, it changes to a solid colour. "xfdesktop --reload" doesn't work after that, nor does "killall -HUP xfdesktop". Trying out

xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-show -s false
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-show -s true

doesn't work either. Running the original command with sudo gives this

Property "/backdrop/screen0/monitor0/image-path" does not exist on channel "xfce4-desktop". If a new property should be created, use the --create option.

The file I'm trying to set as background does exist in the backdrops folder. But I'm not sure what that message exactly means.
Note : I'm not trying to cycle through backgrounds or anything. This is part of a larger theme changing script and I want to change background just once.

I searched the XFCE forums, but no threads had any issued with that command not working at all.

Any Help is appreciated
Thanks

Offline

#2 2013-07-15 05:27:22

MountainDewManiac
Member
From: Where Mr. Bankruptcy is Prez
Registered: 2013-03-24
Posts: 1,115

Re: Cannot change desktop background using command line

Mish wrote:

I can change the Desktop background just fine using the GUI. But when try changing it in terminal using

xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s <name>

it doesn't work. Tried both with and without file extensions. Instead of changing the background to what I want, it changes to a solid colour.

I'm just guessing here, so it probably doesn't apply and has an equal probability of not being correct even if it does. With that being said:

I have only used the GUI to change desktop backgrounds. It's set up so that I can pick one specific background, or I can pick a list (that I have populated the way I like). I get the feeling that these are maintained concurrently(?). I remember the one specific image that I chose when I first installed the distro I'm using. At first (for a very short time) I had trouble with the routine in Xfce that switches my backgrounds from among the list I specified every n minutes because I did not, at that time, know that there were Xfce 4.10 and 4.12 PPAs that I could add to my sources in order to fix the desktop background bug (and a couple more, add features, et cetera). So I had a list of preferred backgrounds, but the switcher routine was only working sporadically.

At that point I discovered that I could flip the setting (in the GUI) from the list, to the specific single background choice - which continued to be the one I had originally chosen - and back to my list - and that it would randomly(?) choose one of them. IOW, at no time did I have to "choose my choice for the single choice" over again, and at no time did I need to repopulate my choices in the list. Whichever I chose, it maintained BOTH sets of, err, choices.

What I'm getting at: I wonder if, in the GUI, your desktop is set up to choose from a list of backgrounds, and the one you're attempting to set from the terminal isn't in that list. Or... possibly that you're set up for one specific background and, it not being the one you're attempting to set, the bit of code that does it borks.

Can you try telling your GUI background setting to pick from a list and then open a terminal window and attempt to manually change your background to a different image but one that is on your list of "allowed" images? Maybe the routine that won't let the system place a non-listed image on the background is being a little to vigilant at doing its job, lol.

BtW, I hope that the above made at least a little more sense to you when you read it than it did to me just now. I seem to be guilty of typing whilst being exhausted. (Apologies.)

Regards,
MDM

EDIT: Assuming the above fails to make any difference - or even if it does - you might consider adding those two Xfce PPAs that I mentioned. At least one of the bugs that was addressed had to do with the desktop image background... stuff.

Last edited by MountainDewManiac (2013-07-15 05:29:24)


Mountain Dew Maniac

How to Ask for Help <=== Click on this link

Offline

#3 2013-07-15 07:31:21

paolo321
Member
Registered: 2011-06-26
Posts: 121

Re: Cannot change desktop background using command line

Strange, it works for me...
Maybe filenames you are using contains spaces, special characters or anyway something that bash doesn't like?
In that case, try quoting filename with double quotes, or post the full command line that doesn't work...

Offline

#4 2013-07-15 11:46:33

Mish
Member
Registered: 2013-07-14
Posts: 3

Re: Cannot change desktop background using command line

MountainDewManiac wrote:

What I'm getting at: I wonder if, in the GUI, your desktop is set up to choose from a list of backgrounds, and the one you're attempting to set from the terminal isn't in that list. Or... possibly that you're set up for one specific background and, it not being the one you're attempting to set, the bit of code that does it borks.

Can you try telling your GUI background setting to pick from a list and then open a terminal window and attempt to manually change your background to a different image but one that is on your list of "allowed" images? Maybe the routine that won't let the system place a non-listed image on the background is being a little to vigilant at doing its job, lol.

Tried that. Still doesn't work. Shows exactly the same behaviour

MountainDewManiac wrote:

EDIT: Assuming the above fails to make any difference - or even if it does - you might consider adding those two Xfce PPAs that I mentioned. At least one of the bugs that was addressed had to do with the desktop image background... stuff.

Speaking of PPAs, I did a dist-upgrade after adding the Xubuntu PPA for XFCE 4.10 to make sure I don't have anything outdated. Still no joy. The command line doesn't work.

paolo321 wrote:

Strange, it works for me...
Maybe filenames you are using contains spaces, special characters or anyway something that bash doesn't like?
In that case, try quoting filename with double quotes, or post the full command line that doesn't work...

The filename doesn't contain any special characters (it's "xfce-blue.jpg" if you want to know). Using double quotes doesn't work either. I wonder what the error message that I get when trying the command as root means.

Offline

#5 2013-07-15 12:18:51

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,042

Re: Cannot change desktop background using command line

I wonder what the error message that I get when trying the command as root means.

You shouldn't run that command as root. xfdesktop runs as the user and configs are user-based. The error means that the configs have not been setup for the root user and are not available, which is really moot since xfdesktop is running as the user not root.

I can change the Desktop background just fine using the GUI.

Just to be sure, by GUI do you mean "Settings Manager -> Desktop"?



What does this command show:

xfconf-query -c xfce4-desktop -p /backdrop -lv

/backdrop/screen0/monitor0/image-show needs to be set to true for the image to display:

xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-show -s true
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s /usr/share/backgrounds/xfce/xfce-blue.jpg

Then check:

xfconf-query -c xfce4-desktop -p /backdrop -lv

...again to make sure /backdrop/screen0/monitor0/image-show is set properly.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#6 2013-07-15 16:25:59

Mish
Member
Registered: 2013-07-14
Posts: 3

Re: Cannot change desktop background using command line

ToZ wrote:

I wonder what the error message that I get when trying the command as root means.

You shouldn't run that command as root. xfdesktop runs as the user and configs are user-based. The error means that the configs have not been setup for the root user and are not available, which is really moot since xfdesktop is running as the user not root.

Oh ok got it

ToZ wrote:

I can change the Desktop background just fine using the GUI.

Just to be sure, by GUI do you mean "Settings Manager -> Desktop"?

Yes that's the one

ToZ wrote:

What does this command show:

xfconf-query -c xfce4-desktop -p /backdrop -lv

Here's the output

/backdrop/screen0/monitor0/backdrop-cycle-enable  true
/backdrop/screen0/monitor0/backdrop-cycle-timer   1
/backdrop/screen0/monitor0/brightness             0
/backdrop/screen0/monitor0/color1                 <<UNSUPPORTED>>
/backdrop/screen0/monitor0/color2                 <<UNSUPPORTED>>
/backdrop/screen0/monitor0/color-style            0
/backdrop/screen0/monitor0/image-path             /usr/share/xfce4/backdrops/walker_by_ljfhutch-d57sjg7.jpg
/backdrop/screen0/monitor0/image-show             true
/backdrop/screen0/monitor0/image-style            5
/backdrop/screen0/monitor0/last-image             /usr/share/xfce4/backdrops/walker_by_ljfhutch-d57sjg7.jpg
/backdrop/screen0/monitor0/last-image-list        /home/shubham/.config/xfce4/desktop/backdrop.list
/backdrop/screen0/monitor0/last-single-image      /usr/share/xfce4/backdrops/walker_by_ljfhutch-d57sjg7.jpg
/backdrop/screen0/monitor0/saturation             1.000000

It is already set to 'true'.

Offline

#7 2013-07-15 17:17:58

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,042

Re: Cannot change desktop background using command line

Now this is interesting. On my Xubuntu 13.04 install, it works fine. I'm just having a look an Manjaro Linux and happen to be on this system now. And it doesn't work! Everything looks to be the same, but I can't change the background either using xfconf-query. Really odd.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#8 2013-07-15 17:18:40

paolo321
Member
Registered: 2011-06-26
Posts: 121

Re: Cannot change desktop background using command line

I don't have backdrop-cycle-enable in my xfconf output... Maybe your xfce wallpaper is set to "image list" in the related settings window? Mine is set as "single image", then I just run a command to change wallpaper.
If you are changing image with a script and xfce tries to build an image list, maybe something "confusing" happen (just my 2 cents)....
Do you have problems with that command if you select "single image" ?

EDIT: I was writing when you wrote last post, so I was writing about your _previous_ post :-)

Last edited by paolo321 (2013-07-15 17:19:45)

Offline

#9 2013-07-15 18:00:05

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,042

Re: Cannot change desktop background using command line

Not the OP, but I got it working again on manjaro. Not sure what the secret was, but among other things I installed the xfconf package and restarted xfsettingsd:

xfsettingsd --replace

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Board footer

Powered by FluxBB