Skip to content

Instantly share code, notes, and snippets.

@lifeparticle
Created March 26, 2019 05:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lifeparticle/ffc7fc711086ba5f6442537d067f1be9 to your computer and use it in GitHub Desktop.
Save lifeparticle/ffc7fc711086ba5f6442537d067f1be9 to your computer and use it in GitHub Desktop.
#!/bin/bash
# <bitbar.title>Sunrise and sunset time</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>S Mahbub-Uz Zaman</bitbar.author>
# <bitbar.author.github>lifeparticle</bitbar.author.github>
# <bitbar.desc>Sunrise and sunset time</bitbar.desc>
# <bitbar.image></bitbar.image>
# <bitbar.dependencies></bitbar.dependencies>
# <bitbar.abouturl></bitbar.abouturl>
city="Sydney+NSW+Australia"
echo "📷"
echo "---"
sr=$(curl -sS https://sunrise-sunset.org/search?location=${city} | grep -EOI "Sunrise time:" | head -1 | egrep -o '\d+\:\d+\:\d+.[A-Z]+')
echo "Sunrise : $sr | color=red"
ss=$(curl -sS https://sunrise-sunset.org/search?location=${city} | grep -EOI "Sunset time:" | head -1 | egrep -o '\d+\:\d+\:\d+.[A-Z]+')
echo "Sunset : $ss | color=cadetblue"
echo "---"
fl=$(curl -sS https://sunrise-sunset.org/search?location=${city} | grep -EOI "First light at" | head -1 | egrep -o '\d+\:\d+\:\d+.[A-Z]+')
echo "First light : $fl | color= red"
ll=$(curl -sS https://sunrise-sunset.org/search?location=${city} | grep -EOI "Last light at" | head -1 | egrep -o '\d+\:\d+\:\d+.[A-Z]+')
echo "Last light : $ll | color=cadetblue"
echo "---"
echo "website | color=purple href=https://sunrise-sunset.org/search?location=Sydney+NSW%2C+Australia"
@lifeparticle
Copy link
Author

A plugin for https://getbitbar.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment