l3ib / nitrogen

Background browser and setter for X windows.
http://projects.l3ib.org/nitrogen
GNU General Public License v2.0
359 stars 38 forks source link

get the filename of the currently set wallpaper via shell #162

Open chrkoewar opened 1 year ago

chrkoewar commented 1 year ago

If the background is set via --random option I found no way to retrieve the filename. If you have a large database and you don't know your images by heart that's a problem. Solutions?

TheStutterNerd commented 3 weeks ago

The locations for the set backgrounds are usually in ~/.config/nitrogen/bg-saved.cfg.

I'm currently watching for the file change using inotifywait so I can execute a script after background change. You can read the path via sed '2q;d' bg-saved.cfg | cut -d "=" -f2. Note, this only reads line 2 (path from desktop 1) but I'm sure you can modify it to your needs.

I know this issue was opened ages ago. Just leaving this here in case anyone else comes across this git issue.