dotfiles

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

dwmblock-iss (1410B)


      1 #!/bin/sh
      2 iss_stream_1="https://www.youtube.com/watch?v=P9C25Un7xaM"
      3 iss_stream_2="https://www.youtube.com/watch?v=VdFK-xs_r-4"
      4 show_iss_stream() {
      5   setsid -f mpv --no-osc --loop=inf --no-terminal --profile=low-latency --volume=0 "$1" ;
      6   notify "ISS Tracker" "Opening stream..."
      7 }
      8 
      9 iss_img="${XDG_CACHE_HOME:-$HOME/.cache}/iss.png"
     10 
     11 get_iss_pos() {
     12   notify-send "ISS" "Pulling most recent ISS position map."
     13   curl -sL "https://heavens-above.com/orbitdisplay.aspx?satid=25544&icon=iss&width=600&height=600" -o "$iss_img"
     14 }
     15 
     16 iss_diagram="${XDG_CACHE_HOME:-$HOME/.cache}/iss.png"
     17 get_iss_diagram() {
     18   notify-send "ISS" "Pulling most recent ISS position map."
     19   # From https://www.nasa.gov/international-space-station/space-station-facts-and-figures/
     20   curl -sL "https://www.nasa.gov/wp-content/uploads/2023/05/iss-blowout-updated-view-2023-300.png" -o "$iss_diagram"
     21 }
     22 
     23 showimg() { setsid -f nsxiv "$1" ;}
     24 case $BUTTON in
     25     1) case "$(printf 'Map\nStream 1 (Harmony)\nStream 2 (zenith)\nDiagram' | dmenu -i -l 3 -p "Choose:")" in
     26         'Map')
     27           get_iss_pos && showimg "$iss_img";;
     28         'Stream 1 (Harmony)')
     29           show_iss_stream "$iss_stream_1";;
     30         'Stream 2 (zenith)')
     31           show_iss_stream "$iss_stream_2";;
     32         'Diagram')
     33           get_iss_diagram && showimg "$iss_diagram";;
     34         *);;
     35       esac
     36       ;;
     37       6) "$TERMINAL" -e "$EDITOR" "$0" ;;
     38 esac
     39 
     40 printf '🛰'