forked from matryer/xbar-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8570ea4
commit 7d4d641
Showing
1 changed file
with
23 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,46 +5,31 @@ | |
# <bitbar.author>Ben Sehl</bitbar.author> | ||
# <bitbar.author.github>benjaminsehl</bitbar.author.github> | ||
# <bitbar.desc>Change your status on Slack from the menubar.</bitbar.desc> | ||
# <bitbar.dependencies></bitbar.dependencies> | ||
# <bitbar.dependencies>Autocode, Slack</bitbar.dependencies> | ||
|
||
# Sign up for Statushook | ||
BASE='https://api.statushook.cool/v1/prod/webhook/fire?id=' | ||
# Sign up for an account at Autocode | ||
|
||
# To keep things tidy, put the ids for your webhooks in variables | ||
FOCUS='' | ||
VACATION='' | ||
DONE='' | ||
BREAK='' | ||
MEETING='' | ||
LUNCH='' | ||
if [ -z ${1+x} ] | ||
then | ||
echo "| image=iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAhGVYSWZNTQAqAAAACAAFARIAAwAAAAEAAQAAARoABQAAAAEAAABKARsABQAAAAEAAABSASgAAwAAAAEAAgAAh2kABAAAAAEAAABaAAAAAAAAAJAAAAABAAAAkAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAHKADAAQAAAABAAAAHAAAAAB2hRU3AAAACXBIWXMAABYlAAAWJQFJUiTwAAACZmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1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bwacpHQWZCcUfVVRk4eyPVJcWxR+I0Yxq5W1ml5LuhXWdonurt29afoNr+B/HCkaLhQ/F7IEvx3QyU/Qd9WVes+i9FGHxH6CjevKnuUdHsn29djdTEC920AvtfgOf0MHqEfvWgy+EH0ZFMaIsB1GHw0vQfEF/khapfLYopkF+2ALNIWNEPdxKk4/s6OpjrTbZWFNgdNsgLHQ9P+Cs1WuQ3Nsh84OoCzSPiczuBc+gy/ga+hCtcWZXslt44XSxXmlrpnSNuhzNRz04rSZwAT0TfB1IfCABtrTYU+hX9Ur1p5SiGJ1dkB3YEWaoglZ6vMJusrnVNo7/FMcOmrF1C2AH2k/QibQvxjFO+sOzV4P9m/xtEXZmxonM/gmMoHguSiem34iztorZJ8DTsWvK7ft+wK/Q1PtkVRjcfITcx0W8ZRGXPC9BcMr9I0EJ6BvgC8L9kbqTYxt5vt09vJaxGfmPrqvyrZss/S1izdwGnRHMVlcKf2K9KoUY8+b0pUwrkWkzLRafWugMCWer+c4E86D+s6BUb2og8K0mvbVKm+h18LBDBbvoYViv3ABIs7cyT+mnr9XykW58DLtj2vR64R7oHCQ+ALso2h0iom0FzERu3fRZ04f75iLcYFl2u/YYreP90ny3EljO3Q1R+m7hRS26yGlHr+dxN7DYS10IicvxljFbspqPYn/ZYvGjn9AX0ol8iAU8U5aAKLLAKQXfEKWKeafgUoN/Gqfp3Lq4lkqhdQ+XT7IizCegZ6l8f5z288uLiCdvDhGPBT9qQhwKhrr7drUFGHafEXai53ofrKWM55P5cjyuPr+l87SAPGilKVxcVaWuwv+mmN3ZFlXDDZhTOBhCwd3l5a8sIJjwiiMOMP4o5Uch/VjOnREroHx1f6FLu7AVjgW3oIibOrrcmw6rmFNmAPS7hmgGz6B3+BFWDs3dD9t56A231+vVr0aqM37B5qm8sUxGfm7AAAAAElFTkSuQmCC"; | ||
else | ||
curl -s --request POST \ | ||
--url "https://YOURUSERNAME.api.stdlib.com/slack-status@dev/" \ | ||
--header 'content-type: application/json' \ | ||
--data '{ | ||
"email": "'"$1"'", | ||
"emoji": "'"$2"'", | ||
"text": "'"$3"'", | ||
"expiration": "'"$4"'" | ||
}'; | ||
fi | ||
|
||
case $1 in | ||
'focus') | ||
curl -s $BASE$FOCUS | ||
;; | ||
'meeting') | ||
curl -s $BASE$MEETING | ||
;; | ||
'break') | ||
curl -s $BASE$BREAK | ||
;; | ||
'lunch') | ||
curl -s $BASE$LUNCH | ||
;; | ||
'done') | ||
curl -s $BASE$DONE | ||
;; | ||
'vacation') | ||
curl -s $BASE$VACATION | ||
;; | ||
esac | ||
# Configure whatever statuses you want, with your email on slack, the emoji shortcode, the text, and how long you want it to last for | ||
|
||
|
||
echo "| image=iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAhGVYSWZNTQAqAAAACAAFARIAAwAAAAEAAQAAARoABQAAAAEAAABKARsABQAAAAEAAABSASgAAwAAAAEAAgAAh2kABAAAAAEAAABaAAAAAAAAAJAAAAABAAAAkAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAHKADAAQAAAABAAAAHAAAAAB2hRU3AAAACXBIWXMAABYlAAAWJQFJUiTwAAACZmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9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TfB1IfCABtrTYU+hX9Ur1p5SiGJ1dkB3YEWaoglZ6vMJusrnVNo7/FMcOmrF1C2AH2k/QibQvxjFO+sOzV4P9m/xtEXZmxonM/gmMoHguSiem34iztorZJ8DTsWvK7ft+wK/Q1PtkVRjcfITcx0W8ZRGXPC9BcMr9I0EJ6BvgC8L9kbqTYxt5vt09vJaxGfmPrqvyrZss/S1izdwGnRHMVlcKf2K9KoUY8+b0pUwrkWkzLRafWugMCWer+c4E86D+s6BUb2og8K0mvbVKm+h18LBDBbvoYViv3ABIs7cyT+mnr9XykW58DLtj2vR64R7oHCQ+ALso2h0iom0FzERu3fRZ04f75iLcYFl2u/YYreP90ny3EljO3Q1R+m7hRS26yGlHr+dxN7DYS10IicvxljFbspqPYn/ZYvGjn9AX0ol8iAU8U5aAKLLAKQXfEKWKeafgUoN/Gqfp3Lq4lkqhdQ+XT7IizCegZ6l8f5z288uLiCdvDhGPBT9qQhwKhrr7drUFGHafEXai53ofrKWM55P5cjyuPr+l87SAPGilKVxcVaWuwv+mmN3ZFlXDDZhTOBhCwd3l5a8sIJjwiiMOMP4o5Uch/VjOnREroHx1f6FLu7AVjgW3oIibOrrcmw6rmFNmAPS7hmgGz6B3+BFWDs3dD9t56A231+vVr0aqM37B5qm8sUxGfm7AAAAAElFTkSuQmCC" | ||
echo "---" | ||
echo ":hear_no_evil: Focus | bash='$0' param1=focus terminal=false refresh=true" | ||
echo ":calendar: In a meeting | bash='$0' param1=meeting terminal=false refresh=true" | ||
echo ":walking: Taking a break | bash='$0' param1=break terminal=false refresh=true" | ||
echo ":hamburger: Eating lunch | bash='$0' param1=lunch terminal=false refresh=true" | ||
echo ":sunglasses: Done for the day | bash='$0' param1=done terminal=false refresh=true" | ||
echo ":palm_tree: On vacation | bash='$0' param1=vacation terminal=false refresh=true" | ||
echo ":hear_no_evil: Focus | bash='$0' param1=[email protected] param2=hear_no_evil param3='Focus mode' param4='in four hours' terminal=false refresh=true" | ||
echo ":calendar: In a meeting | bash='$0' param1=[email protected] param2=calendar param3='In a meeting' param4='in one hour' terminal=false refresh=true" | ||
echo ":walking: Taking a break | bash='$0' param1=[email protected] param2=walking param3='Taking a break' param4='in half an hour' terminal=false refresh=true" | ||
echo ":hamburger: Eating lunch | bash='$0' param1=[email protected] param2=hamburger param3='Eating lunch' param4='in one hour' terminal=false refresh=true" | ||
echo ":sunglasses: Done for the day | bash='$0' param1=[email protected] param2=sunglasses param3='Done for the day' param4='tomorrow at 8am' terminal=false refresh=true" | ||
echo ":palm_tree: On vacation | bash='$0' param1=[email protected] param2=palm_tree param3='On vacation' param4='in one week' terminal=false refresh=true" |