Skip to content

Instantly share code, notes, and snippets.

@lfender6445
Last active September 12, 2018 07:50
  • Star 13 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save lfender6445/70b00c97df43827279f7 to your computer and use it in GitHub Desktop.
Never go idle in hipchat - Disable hipchat idle when away from computer
#! /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