Refactor default image viewer finding

This commit is contained in:
Marty Oehme 2023-01-08 17:27:39 +01:00
parent 94a2dfcef7
commit 5a6c826ca5
Signed by: Marty
GPG key ID: 73BA40D5AFAF49C9

15
uoeia
View file

@ -86,17 +86,10 @@ dereference() {
} }
get_imageviewer() { get_imageviewer() {
if command -v nsxiv 1>/dev/null 2>&1; then for cmd in nsxiv sxiv feh imv vimiv; do
echo nsxiv if command -v "$cmd" 1>/dev/null 2>&1; then program="$cmd"; break; fi
elif command -v sxiv 1>/dev/null 2>&1; then done
echo sxiv echo "$program"
elif command -v feh 1>/dev/null 2>&1; then
echo feh
elif command -v imv 1>/dev/null 2>&1; then
echo imv
elif command -v vimiv 1>/dev/null 2>&1; then
echo vimiv
fi
} }
main() { main() {