Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-05-26 00:46:53

schwim
Member
From: Coastal VA, Murica
Registered: 2022-05-26
Posts: 14
Website

Changing desktop background folder with many files inside fails

Hello there folks!

I've got a quick question for everyone.  In my OS running OB, I use nitrogen to pull a random image file from a folder of 2,000+ desktop bg images and use a cron job to rotate images every X minutes. When I select my bg folder in right-click/Desktop Settings, it selects and loads the images in the window(albeit, taking a while).  I wait for it to stop loading thumbnails and for the CPU to go idle then choose close but images continue to get pulled from the stock backdrop folder.  When I open Desktop Settings, the folder has reverted to the stock location.

Is there a way to get the stock XFCE bg manager to save a folder location with many images?

Thanks for your time!

Offline

#2 2022-05-26 01:12:58

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Changing desktop background folder with many files inside fails

Hello and welcome.

If you are using a newer version of xfdesktop (the bg manager), then select the folder in the "Folder" field in its Settings dialog. This will display the image files in that folder. Manually select one of those images and it will save the folder location for you.

Edit: alternatively, you can use xfconf-query (if the xfconfd process is running) to change the background as well. You'll need to determine the X location of the wallpaper first. You can do this by running "xfconf-query -c xfce4-desktop -mv" in a terminal window and manually changing the wallpaper to see its location displayed in the terminal.

Last edited by ToZ (2022-05-26 01:15:54)


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

#3 2022-05-26 02:23:34

schwim
Member
From: Coastal VA, Murica
Registered: 2022-05-26
Posts: 14
Website

Re: Changing desktop background folder with many files inside fails

ToZ wrote:

Hello and welcome.

If you are using a newer version of xfdesktop (the bg manager), then select the folder in the "Folder" field in its Settings dialog. This will display the image files in that folder. Manually select one of those images and it will save the folder location for you.

Edit: alternatively, you can use xfconf-query (if the xfconfd process is running) to change the background as well. You'll need to determine the X location of the wallpaper first. You can do this by running "xfconf-query -c xfce4-desktop -mv" in a terminal window and manually changing the wallpaper to see its location displayed in the terminal.

Selecting one of the images worked fantastically, thanks so much for your help!

Offline

#4 2022-05-28 17:46:51

Misko_2083
Member
Registered: 2015-10-13
Posts: 191
Website

Re: Changing desktop background folder with many files inside fails

ToZ wrote:

Hello and welcome.

If you are using a newer version of xfdesktop (the bg manager), then select the folder in the "Folder" field in its Settings dialog. This will display the image files in that folder. Manually select one of those images and it will save the folder location for you.

Edit: alternatively, you can use xfconf-query (if the xfconfd process is running) to change the background as well. You'll need to determine the X location of the wallpaper first. You can do this by running "xfconf-query -c xfce4-desktop -mv" in a terminal window and manually changing the wallpaper to see its location displayed in the terminal.

I think fetching thumbnails takes a lot of time.
With yad version 12 (latest from github) is easy to make a script for this.

#!/usr/bin/env bash
monitor="$(xfconf-query -c displays -l | grep "/$(xfconf-query -c displays -p /ActiveProfile).*/Active$")"
monitor="${monitor%/${monitor##*/}*}"
monitor="monitor${monitor##*/}"
export monitor

    yad --picture --on-top --size=fit --geometry="600x400-10-35" \
        --image-on-top --no-markup --text="Ctrl+o or Right click -> Open\nto select images" \
        --filename="$(xfconf-query -c xfce4-desktop -p /backdrop/screen0/${monitor}/workspace0/last-image)" \
        --no-buttons --skip-taskbar --file-op \
        --image-changed='bash -c "xfconf-query -c xfce4-desktop -p /backdrop/screen0/${monitor}/workspace0/last-image -s %s"'

Or even better maybe to find all the images and then use right click menu or lef/right keyboard keys to select background.

#!/usr/bin/env bash
monitor="$(xfconf-query -c displays -l | grep "/$(xfconf-query -c displays -p /ActiveProfile).*/Active$")"
monitor="${monitor%/${monitor##*/}*}"
monitor="monitor${monitor##*/}"
export monitor

    yad --picture --on-top --size=fit --geometry="600x400-10-35" \
        --image-on-top --no-markup --text="Left/Right key or Right click -> Next/prev\nto select background." \
        --image-changed='bash -c "xfconf-query -c xfce4-desktop -p /backdrop/screen0/${monitor}/workspace0/last-image -s %s"' \
        --no-buttons --file-op $(find "$HOME/Pictures" -type f -name '*.jpg' -o -name '*.png')

Do you want to exit the Circus?
https://www.youtube.com/watch?v=ZJwQicZHp_c

Offline

Board footer

Powered by FluxBB