Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- URI="$*"
- test -n "$URI" && printf '%s' "$URI" | xsel -i || URI="$(xsel -b)"
- color0="$(xrdb -query | grep color0: | awk '{print $2}')"
- colorbg="$(xrdb -query | grep background: | awk '{print $2}')"
- colorfg="$(xrdb -query | grep foreground: | awk '{print $2}')"
- dmenu_args="-fn fixed:pixelsize=12:lang=ru -nb $colorbg -nf $colorfg -sb $colorfg -sf $colorbg"
- case $URI in
- *.jp*g|*.png|*.gif) img "$URI" ;;
- *.webm|*.mp4|*.ogv) mpv "$URI" ;;
- *youtube.com/*) mpv "$URI" ;;
- *.html) vimb "$URI" ;;
- *.txt) st -e sh -c "curl -s '$URI'|less -R" ;;
- *) case $(echo "copy img text video web" | tr " " "\n" | dmenu $dmenu_args) in
- copy) printf "%s" "$URI" | xsel -ib ;;
- img) img "$URI" ;;
- text) st -g "72x20" -e sh -c "curl -s '$URI'|less -R" ;;
- video) mpv "$URI" ;;
- web) vimb "$URI" ;;
- esac ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement