Last active
September 12, 2018 07:50
-
-
Save lfender6445/70b00c97df43827279f7 to your computer and use it in GitHub Desktop.
Never go idle in hipchat - Disable hipchat idle when away from computer
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