Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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

This comment has been minimized.

Copy link
Owner Author

commented Mar 26, 2019

A plugin for https://getbitbar.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.