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
1 changed files with 4 additions and 11 deletions

15
uoeia
View File

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