So glad a colleague at work pointed me to what Goldfinger were up to - making the most of social isolation in times of Covid-19! This video, “Here in your bedroom”, is a nostalgia trip.
I set up a Raspberry Pi photo viewer at work to display photos from members of the photo club. Members were instructed to put their photos on a Google Drive location (accessible only within the company VPN) and then the viewer would sync down the photos at a predetermined schedule. To get access to Google Drive, I used rclone. To display I used ‘feh’, which was also used to put text indicating the name of the photo.
Two scripts are set to launch on boot. One plays music, the other starts feh.
The directory structure was such that from the root folder to be synced, photographers created a folder with their name and put their photos within it. I requested that the photos have creative names. Given this format, I could put a watermark on each photo in the bottom left by doing the following:
I want to get the author name (lowest-level directory) and photo name (name of jpg file), strip off the jpg extension, and replace the directory separate “/” with a spaced hyphen " - “. To do this, I:
Get the path of the currently displayed photo “echo %F”.
To get the lowest level directory, I want to grab the directory and filename at the end. I don’t know how many directories deep this will be, but if reversed, I know it will be the first and second elements (if “/” is considered as a separator: rev | cut -d’/’ -f1-2
I then want to reverse the result back, and strip off the .jpg from the filename (really, anything starting with “.”): rev | sed -r ’s/[.].*//'
Finally, I want to replace the “/” with a hyphen, so it will be “Firstname Lastname - Name of photo”: sed -r ’s/\// - /'
TODO: Starting photo viewer and music player on boot.