Not because I have nothing to do but I run a slideshow on my desktop that contains hundreds of images. So it is just nice to look at.
So nice that I also wanted an annotation on the screen along with the images. Hence I wrote a prove of concept script to do that and it seems to work
However it soon becomes clear that you don't want this when the desktop background is not visible.
Notify-send has no 'unfocus' option afaik and --urgency=low doesn't seem to have any effect.
So I am looking for a way to test the amount of emptiness on the desktop so I can make the notify-send conditional.
Here's the script:
Code: Select all
#!/usr/bin/bash
# Vimes 2022.
# Dependencies: inotify-tools
myself="${0##*/}"
version="$myself - version 0.1"
echo $version
# Kill other instances of myself
for pid in $(pidof -x "$myself"); do
(( pid == $$ )) || kill -SIGINT $pid
done
# Activate sleep command as builtin. bash-builtins should be installed for
# this to work. if not sleep will be run as separate process.
enable -f /usr/lib/bash/sleep sleep
# Graceful end
trap "logger \"${myself}[$$] killed\"; exit" SIGHUP SIGINT SIGTERM SIGKILL
# Mainline
# -------------------------------------------------------------------------------------------------------
while true; do
resp="$(inotifywait -r --event open --format='%w|%f' '/usr/share/backgrounds')" #TODO use monitor mode
dir="$(cut -d'|' -f1 <<<$resp)"
file="$(cut -d'|' -f2 <<<$resp)"
sleep 7 # wait a bit for the transition effect
notify-send -u low -i "$HOME/.icons/feather-orange/image.svg" "$file" "From: $dir"
done