1

I have a hundreds of images in some folder and use xmlback script to generate background.xml file and set it as a wallpaper.

So, now:

$ gsettings get org.gnome.desktop.background picture-uri
'file:////home/itsme/Images/ng-wallpaps/background.xml'

How can I get current image file name (or position inside xml file), exaclty?

It does not depend of xmlback, however, with one of packaged dynamic backgrounds i have this result:

$ gsettings get org.gnome.desktop.background picture-uri
'file:///usr/share/backgrounds/contest/cosmic.xml'
0

You can use xmllint with the --xpath setting to extract relevant parts of an XML document:

xmllint --xpath 'string(/background/static/file)' /usr/share/backgrounds/contest/cosmic.xml

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.