Created
June 18, 2020 20:33
-
-
Save BrunoNZ/3826db86fb12f47522628d3ca10ae411 to your computer and use it in GitHub Desktop.
A script that adds to the images files stored at "~/.cache/wallpaper" a mark containing the display ID and the resolution, both extracted from the filename. After executing the script, restart the session and then the mark appears, as the cached files are loaded.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if ( ! command -v convert >/dev/null 2>&1 ); then | |
echo -e "\"Convert\" is required but it's not installed." | |
echo -e "Install \"imagemagick\" package and retry." | |
exit 1 | |
fi | |
case $XDG_CURRENT_DESKTOP in | |
"X-Cinnamon") DIR_CACHE=~/.cache/wallpaper ;; | |
"MATE") DIR_CACHE=~/.cache/mate/background ;; | |
*) DIR_CACHE=~/.cache/wallpaper ;; | |
esac | |
for f in $(find ${DIR_CACHE} -name "[0-9]_*"); do | |
disp_id=$(basename $f | cut -d "_" -f1,3,4) | |
convert -pointsize 50 -fill yellow -draw "text 50,100 \"${disp_id}\"" $f $f | |
done | |
~ | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment