dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

uri-handler-gemini.cgi (506B)


      1 #!/bin/sh
      2 # gemini://gempaper.strangled.net/mirrorlist/
      3 # gemini://simplynews.metalune.xyz
      4 # gemini://geminispace.info/search?tmux
      5 
      6 # remove gemini:// header
      7 QUERY_STRING=${QUERY_STRING#gemini://}
      8 
      9 testproxy() { curl --connect-timeout 1 -s -I -w '%{http_code}' "$1" | head -n1 | grep 200 > /dev/null; }
     10 
     11 if testproxy "https://portal.mozz.us/about"; then
     12   echo "W3m-control: GOTO https://portal.mozz.us/gemini/$QUERY_STRING"
     13 else
     14   echo "W3m-control: GOTO https://proxy.vulpes.one/gemini/$QUERY_STRING"
     15 fi