aboutsummaryrefslogtreecommitdiff
path: root/sxiv/.bash/sxiv.bash
blob: 7a200fe1c82d52f2b491992de6f9aa3a09b64b7f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# SXIV specific config options imported by .bashrc

# Seamlessly display an image in SXIV, even when an URL is provided.
# Note that no check is performed on the URL.
img() {
    case $@ in
		http*://*)
            local img=$(mktemp)
            curl -o "$img" -s "$@"
            sxiv "$img"
            ;;
		*)
            sxiv "$@"
            ;;
	esac
}