dotfiles

personal configuration files and scripts
git clone https://tongong.net/git/dotfiles.git
Log | Files | Refs | README

qr (389B)


      1 #!/usr/bin/env sh
      2 
      3 # qr - opens an qrcode of input string instantly
      4 # at the moment sxiv is used, but this can easily substituted
      5 
      6 # USAGE EXAMPLE:
      7 # > qr duckduckgo.com
      8 
      9 # test for enough command line arguments
     10 if [ $# -lt 1 ]; then
     11 	echo "not enough arguments."
     12 	exit 1
     13 fi
     14 
     15 # create temporary file
     16 file=$(mktemp)
     17 
     18 # open the qr-code
     19 qrencode -o "$file" "$1"
     20 
     21 sxiv "$file"
     22 
     23 rm -f "$file"