I'm extracting the icon path from the .desktop files.
Sometimes the files contain the absolute path to the file i.e
Other times its just the name of the file no ext
I'm currently searching the /usr/share/icons/hicolor folders for the icon name. But when the icon path is absolute and points to a file i'm getting no results as find is looking in the wrong location.
Is there a way to tell in my bash script if a string is an image?
I'm trying to check with:
But obviously it errors if the path does not exist.
Is there a better way?
What would you do?