My education is severely limited. I know this should be easy, but I’m scratching my head.
The issue:
I use Variety wallpaper changer, which has a command ‘variety --get’ which will get information about the current wallpaper:
variety --get
Variety is already running. Sending the command to the running instance.
/home/ben/.config/variety/Downloaded/Unsplash/photo-1699656844811-ce67291ab27a.jpg
So I can send this output to a file (just the second line, not the first informational line):
variety --get > /temp/variety-get.txt
This gives me the <URL> as text.
What I actually want to do is launch gwenview <url> and/or GIMP <url>. This works in terminal…
I tried 'gimp < url.txt` but obviously it doesn’t read the file, it tries to open it.
Also piping variety --get | gimp doesn’t pass the URL to GIMP.
Note: I have no idea about variety, but I do know gimp can be picky about paths. cat should work to print the file contents, and as long as those exist and are full (I dont believe ~ works) it should open that file in gimp. Of course you can also use flags like -a (as new), etc.
An alternative solution might to make up a couple of scripts called something like “varietygwen” & “varietygimp”. That way you don’t have to type the text file path or anything to run it. I didn’t think of using cat to read the file, but use while/read for each line in the file. Here’s something I quickly wrote to open in gwenview:
#!/bin/bash
variety --get > /tmp/variety-get.txt
while read -r line; do
gwenview "${line}"
done < /tmp/variety-get.txt
exit 0
There was a conflict with setting volume at 10% which is like a ‘v’ with an ‘0’… so I opted for ‘variety explore’ to open gwenview, then a squiggly g to edit.