Idle Buster

Idle Buster – a simple program to keep your PC awake. Idle Buster keeps your computer from going idle for a user settable amount of time.

Download the free Idle Buster program in our shop.:

This simple python program uses pyautogui to:

  1. Ask the user what their idle time out is in minutes.
  2. Verifies the user entered a number.
  3. Gets the amount of time the PC has been idle
  4. If the idle time is more than the time out entered by the user, presses the shift key twice to keep the PC wake.

To run the program, just double click the script and enter your idle time out. To exit, select the terminal window and press CRTL+C.

By downloading the and running the files below, you assume all responsibly for running and operating the software. Thinktwisted.com and its proprietors assume no responsibility or liability for lost data, damaged systems, or corrupted information.

See the code snippet below or the full respository at Github – https://github.com/thinktwisted/IdleBuster


#!python3
# IdleBuster.py - a simple program to keep your computer wake

import win32api, time
import pyautogui as gui

def getIdleTime():
    '''A function to return the idle time of the PC in seconds'''
    return (win32api.GetTickCount() - win32api.GetLastInputInfo())/1000

validInput = False
run = True

while not validInput:
    idleTime = input('What is your idle time [1-60 minutes]? ')
    try:
        int(idleTime)
        break;
    except ValueError:
        continue
    except TypeError:
        exit()

idleTime = int(idleTime)*60
wiggleCount = 0
print('Idle time [sec]: ' + str(idleTime))

while run:
    currentTime = getIdleTime()
    if (currentTime) > idleTime-1.5:
        for i in range(2):
            gui.press('shift')
            time.sleep(1)
        wiggleCount += 1
        print('%s - Shift pressed idle time was %s' % (str(wiggleCount), str(currentTime)))
        try:
            for i in range(idleTime-2):
                time.sleep(1)
        except KeyboardInterrupt:
            print('Exiting, total idles avoided: %s' % str(wiggleCount))
            run = False
    else:
        try:
            time.sleep(1)
        except KeyboardInterrupt:
            print('Exiting, total idles avoided: %s' % str(wiggleCount))
            run = False

Leave a Reply

Your email address will not be published. Required fields are marked *