You are not logged in.


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.jpgTo change to day image:
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitoreDP/workspace0/last-image -s /usr/share/backgrounds/images/homer_day.jpgThe 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 -mand 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


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


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
[ Generated in 0.006 seconds, 7 queries executed - Memory usage: 536.42 KiB (Peak: 537.27 KiB) ]