1#!/bin/bash
2
3text=$(sselp)
4
5text=$(echo "$text" | xargs)
6
7[ -z "$text" ] && exit 0
8
9extension="${text##*.}"
10extension=$(echo "$extension" | tr '[:upper:]' '[:lower:]')
11
12case "$extension" in
13 txt|c|html|htm)
14 acme "$text" &
15 ;;
16 pdf)
17 helium "$text" &
18 ;;
19 png|jpg|jpeg|gif|bmp|webp|svg|tiff|ico)
20 nsxiv -b "$text" &
21 ;;
22 *)
23 acme "$text" &
24 ;;
25esac