Last active
August 29, 2015 14:04
-
-
Save nosada/fa1a950f9d1542548009 to your computer and use it in GitHub Desktop.
comfortable operation with Yo
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
| #!/usr/bin/sh | |
| token="<YOUR_API_TOKEN>" | |
| name="<DESIRED_USERNAME>" | |
| notifymsg="Yo from <SOURCE_Yo_NAME> to <DESTINATION_Yo_NAME>" | |
| icon="/path/to/icon" | |
| # do desired task | |
| $@ | |
| # after finished task, Yo to notify that | |
| curl http://api.justyo.co/yo/ -X POST -d \ | |
| "api_token=${token}&username=${name}" \ | |
| > /dev/null 2>&1 | |
| # notify yotify | |
| p=`ps -ef | grep Xorg | grep -v grep | wc -l` | |
| if [ $p -gt 0 ]; then | |
| notify-send "Yotify" "${notifymsg}" --icon=${icon} | |
| else; | |
| echo -e "\033[1;37m"${notifymsg}"\033[0;39m" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment