Change your status on Slack from the menubar.
#!/bin/bash
# <xbar.title>Slack Stuatus</xbar.title>
# <xbar.version>v1.0</xbar.version>
# <xbar.author>Ben Sehl</xbar.author>
# <xbar.author.github>benjaminsehl</xbar.author.github>
# <xbar.desc>Change your status on Slack from the menubar.</xbar.desc>
# <xbar.dependencies>Autocode, Slack</xbar.dependencies>
# Sign up for an account at Autocode
if [ -z ${1+x} ]
then
echo "| image=iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAhGVYSWZNTQAqAAAACAAFARIAAwAAAAEAAQAAARoABQAAAAEAAABKARsABQAAAAEAAABSASgAAwAAAAEAAgAAh2kABAAAAAEAAABaAAAAAAAAAJAAAAABAAAAkAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAHKADAAQAAAABAAAAHAAAAAB2hRU3AAAACXBIWXMAABYlAAAWJQFJUiTwAAACZmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4yPC90aWZmOlJlc29sdXRpb25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tkVRjcfITcx0W8ZRGXPC9BcMr9I0EJ6BvgC8L9kbqTYxt5vt09vJaxGfmPrqvyrZss/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
# 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 "---"
echo ":hear_no_evil: Focus | bash='$0' [email protected] param2=hear_no_evil param3='Focus mode' param4='in four hours' terminal=false refresh=true"
echo ":calendar: In a meeting | bash='$0' [email protected] param2=calendar param3='In a meeting' param4='in one hour' terminal=false refresh=true"
echo ":walking: Taking a break | bash='$0' [email protected] param2=walking param3='Taking a break' param4='in half an hour' terminal=false refresh=true"
echo ":hamburger: Eating lunch | bash='$0' [email protected] param2=hamburger param3='Eating lunch' param4='in one hour' terminal=false refresh=true"
echo ":sunglasses: Done for the day | bash='$0' [email protected] param2=sunglasses param3='Done for the day' param4='tomorrow at 8am' terminal=false refresh=true"
echo ":palm_tree: On vacation | bash='$0' [email protected] param2=palm_tree param3='On vacation' param4='in one week' terminal=false refresh=true"