No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

openbrowser.sh 519B

12345678910111213141516171819
  1. #!/bin/bash
  2. #exec firefox "$@"
  3. set -e
  4. URL=$1
  5. BROWSER=xdg-open
  6. BROWSER=firefox
  7. AES_GCM="$(dirname $(readlink -f $0))/aesgcm"
  8. if [ ${URL: -97:1} == "#" -o ${URL: -89:1} == "#" ]
  9. then
  10. [ -e "$AES_GCM" ] || gcc "$(dirname $(readlink -f $0))/aesgcm.c" -lcrypto -o "$AES_GCM"
  11. iv_key="$(echo "$URL" | sed 's/^.*#//')"
  12. URL="$(echo "$URL" | sed 's/^aesgcm/https/')"
  13. curl "$URL" | "$AES_GCM" "$iv_key" | feh -. -
  14. elif echo $URL | grep -i '\.pgp$'
  15. then
  16. curl "$URL" | gpg2 -d | feh -. -
  17. else
  18. $BROWSER $URL
  19. fi