Guest User

Untitled

a guest
Oct 9th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.67 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. URI="$*"
  4.  
  5. test -n "$URI" && printf '%s' "$URI" | xsel -i || URI="$(xsel -b)"
  6.  
  7. color0="$(xrdb -query | grep color0: | awk '{print $2}')"
  8. colorbg="$(xrdb -query | grep background: | awk '{print $2}')"
  9. colorfg="$(xrdb -query | grep foreground: | awk '{print $2}')"
  10.  
  11. dmenu_args="-fn fixed:pixelsize=12:lang=ru -nb $colorbg -nf $colorfg -sb $colorfg -sf $colorbg"
  12.  
  13. case $(echo "copy img pdf text video web" | tr " " "\n" | dmenu $dmenu_args) in
  14.     copy) printf "%s" "$URI" | xsel -ib ;;
  15.     img) img "$URI" ;;
  16.     pdf) mupdf-x11-curl "$URI" ;;
  17.     text) st -g "72x20" -e sh -c "curl -s '$URI'|less -R" ;;
  18.     video) play "$URI" ;;
  19.     web) chromium "$URI" ;;
  20. esac
Advertisement
Add Comment
Please, Sign In to add comment