Forked from lfender6445/gist:70b00c97df43827279f7
Last active
August 29, 2015 14:08
-
-
Save feniix/f3378ad8a27387674a77 to your computer and use it in GitHub Desktop.
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 | |
# This if for the mac hipchat client | |
# To setup, download this file to any folder and save as `hip.sh` | |
# change the permissions of the file so it is executable using terminal | |
# You can do this by running `chmod u+x ./hip.sh` | |
# Now you can run `./hip.sh` | |
echo 'Hipchat hooray...ho... - Press CTRL+C to stop' | |
while : | |
do | |
osascript <<EOF | |
tell application "Hipchat" to activate | |
do shell script " | |
/usr/bin/python <<END | |
import sys | |
import time | |
from Quartz.CoreGraphics import * | |
def mouseEvent(type, posx, posy): | |
theEvent = CGEventCreateMouseEvent(None, type, (posx,posy), kCGMouseButtonLeft) | |
CGEventPost(kCGHIDEventTap, theEvent) | |
def mousemove(posx,posy): | |
mouseEvent(kCGEventMouseMoved, posx,posy); | |
ourEvent = CGEventCreate(None); | |
currentpos=CGEventGetLocation(ourEvent); | |
mousemove(int(currentpos.x),int(currentpos.y)); | |
END" | |
EOF | |
sleep 299 | |
echo 'Hipchat hooray...ho...' | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment