scripts

My personal collection of scripts
git clone git://src.gearsix.net/scripts
Log | Files | Refs | Atom | README | LICENSE

xopen.sh (706B)


      1 # DEPRECIATED: just made an alias in bashrc (alias xopen='xdg-open')
      2 
      3 #!/bin/sh
      4 # xopen = xdg-open FILE
      5 # description: open file in xserver (doesn't support multiple files at once yet)
      6 # ARGUMENTS: -q, --quiet       send stdout to /dev/null
      7 
      8 if [ -z $1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
      9 	echo "Usage: xopen [OPTIONS] {FILE|URL}..."
     10 	echo ""
     11 	echo "Call 'xdg-open' on all listed {FILE|URL}, see 'xdg --help' for more details."
     12 	echo ""
     13 	echo "OPTIONS (must be provided before {FILE|URL})"
     14 	echo "  -q, --quiet     send stdout to /dev/null because a lot of tools print too much."
     15 	exit
     16 fi
     17 
     18 if [ "$1" = "-q" ] || [ "$1" = "--quiet" ]; then
     19 	shift
     20 	xdg-open $@ &>/dev/null
     21 else
     22 	xdg-open $@
     23 fi