This is now an actual repo:
This file contains hidden or 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
#/bin/bash | |
TOKEN='put your token here. Get a new from https://api.slack.com/docs/oauth-test-tokens' | |
dbus-monitor --session type='signal',interface='com.canonical.Unity.Session' | while true | |
do | |
read x | |
if echo "$x" | grep -q Locked; then | |
echo "set yourself away at $(date)" | |
curl -X GET -H "Cache-Control: no-cache" "https://slack.com/api/users.setPresence?token=$TOKEN&presence=away" |