Xfce Forum

Sub domains
 

You are not logged in.

#1 Yesterday 20:56:50

IamTheSenate
Member
From: Manchester, UK
Registered: Yesterday
Posts: 2
Website
LinuxChrome 143.0

Changing desktop background using bash script- property does not exist

Hi all,

I'm writing a Bash script to change my desktop background on Xfce 4/Fedora 42 to change the desktop background image at set times using Cron. I have created the terminal command to change the images and both work when run in the terminal:

To change to night image:

xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitoreDP/workspace0/last-image -s /usr/share/backgrounds/images/homer_night.jpg

To change to day image:

xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitoreDP/workspace0/last-image -s /usr/share/backgrounds/images/homer_day.jpg

The commands worked successfully to change the image. I create a bash script file called change_desktop.sh to prototype the script. At the moment the only contents are the command above. When the executable file is run, it keeps returning this error in the terminal:

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

I verified the backdrop is correct by monitoring the output of

xfconf-query -c xfce4-desktop -m

and the backdrop is correct. I came across this potential fix and tried it. It has not solved the profile issue however.

The error only occurs if the commands are run inside the script, not when the command is run within the terminal by itself.

I have modified the string inside the file with a '-n' flag at the end to after looking the documentation to make sure a profile exists and if not create one. This resolves the previous error but gives another: 

When creating a new property, the value type must be specified.

I have troubleshooted and research as I can take it. Anyone have any suggestions please?


Fedora 42 Xfce

Offline

#2 Yesterday 23:07:04

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 12,406
LinuxFirefox 146.0

Re: Changing desktop background using bash script- property does not exist

Are you per chance running the script as root or another account than your login account? Although that should generate an xfconfd is not running message.
What version of Xfce are you running?

When creating a new property, the value type must be specified.

You need to specify a property type when creating a new property For example:

xfconf-query -c CHANNEL -p PROPERTY -t TYPE -s VALUE -n

...where TYPE is one of string, bool, int, etc... In this case it would be "string". Ref: https://docs.xfce.org/xfce/xfconf/xfconf-query

However, you shouldn't need to have to create this property if it works manually - leading me to believe that you are running the script as another user. Maybe.


Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 Today 03:34:39

him610
Member
From: Pennsylvania USA
Registered: 2022-02-19
Posts: 39
LinuxChrome 143.0

Re: Changing desktop background using bash script- property does not exist

Sometimes we do things for the challenge then get stuck.

Have you considered opening Settings > Desktop?
At the bottom there is a box where you can choose to change your background at some desired interval.

Happy New Year.


Do no harm.
Respect ones neighbors.
Especially, old friends from the north.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.006 seconds, 7 queries executed - Memory usage: 536.42 KiB (Peak: 537.27 KiB) ]