Skip to content

Instantly share code, notes, and snippets.

@nosada
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save nosada/fa1a950f9d1542548009 to your computer and use it in GitHub Desktop.

Select an option

Save nosada/fa1a950f9d1542548009 to your computer and use it in GitHub Desktop.
comfortable operation with Yo
#!/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