[SOLVED] After adding pictures via bash in Cinnamon, the system can't detect these.

Style your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
AdrianBiro
Level 1
Level 1
Posts: 6
Joined: Sun Oct 17, 2021 11:20 am

[SOLVED] After adding pictures via bash in Cinnamon, the system can't detect these.

Post by AdrianBiro »

I want to set a custom background in the post-installation script. After adding a folder with backgrounds to this path /usr/share/backgrounds system set the background to one of the standards pictures located in /linuxmint folder, or nothing happens at all.
I even tried to extract just pictures to one of the default folders and set wallpaper from there, but the result was similar. The system seemingly does not detect changes. To make a change in it, I need to manually go to in GUI System Settings>Backgrounds>press + sign to add a new folder, then go down to file system where is locating my new folder, and here select one. After that following commands works, but this isn't what I need.
How I can make this in bash, please?
And can by another way better for this, eg. keep this in .scripts directory? I tried that with the same result, but I ask just in case if there is the proper way.
I tried it on Cinnamon 20.2 and LMDE 4 both in a virtual machine and Cinnamon even on real hardware.
I rebooted the system of course, but nothing happens after that.

Code: Select all

# tar -xzvf My_Backgrounds.tar.gz -C /usr/share/backgrounds
gsettings set org.gnome.desktop.background picture-uri "file:///usr/share/backgrounds/My_Backgrounds/My_background.jpg"
[EDIT]
The solution is to place custom backgrounds in the home folder, the way above was overcomplicated.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
shedyed
Level 4
Level 4
Posts: 298
Joined: Wed Feb 03, 2021 5:12 pm

Re: After adding pictures via bash in Cinnamon, the system can't detect these.

Post by shedyed »

Did you try the gsettings on the command line, while in a session, and observe the results?

I use a slightly different command gsetroot but it is the root background (kind of like a separate layer). One of the image viewers qiv has a similar function when I use qiv -x

Try entering that command in an x terminal, and see if it does what you want

EDIT: After taking a second look at the code in your gsettings command, I think the double-quote is in the wrong place. You should enclose only the location of the file. Once you put the beginning quote in the right spot, it will work. Try it in a terminal and see. I think it should be positioned before the three slashes. Why the quote, it is not necessary; after all, there are no spaces in the name.
AdrianBiro
Level 1
Level 1
Posts: 6
Joined: Sun Oct 17, 2021 11:20 am

Re: After adding pictures via bash in Cinnamon, the system can't detect these.

Post by AdrianBiro »

Thanks for your reply. I tried it with more syntax variants (position and types of quote signs [',"] ) and all do the job in the case of default pictures. My problem is that my custom pictures aren't automatically detected until I add them manually. After that commands work.
Locked

Return to “Themes, Icons & Wallpaper”