buildtheeffigy / bubbles_screensaver

fixing the windows 10 bubbles screensaver by running a python script that handles timing
GNU General Public License v3.0
0 stars 0 forks source link

fix? #1

Open 3min32 opened 4 months ago

3min32 commented 4 months ago

thats code is was opening bubbles.txt so i give it toai and did gave this code from ctypes import Structure, windll, c_uint, sizeof, byref import subprocess import time

class LASTINPUTINFO(Structure): fields = [ ('cbSize', c_uint), ('dwTime', c_uint), ]

def get_idle_duration(): lastInputInfo = LASTINPUTINFO() lastInputInfo.cbSize = sizeof(lastInputInfo) windll.user32.GetLastInputInfo(byref(lastInputInfo)) millis = windll.kernel32.GetTickCount() - lastInputInfo.dwTime return millis / 1000.0

bubbles = r"C:\Windows\System32\Bubbles.scr /s" running = False sleepTime = 2 * 60 # 2 minutes

while True: if get_idle_duration() < sleepTime: # we need to wait time.sleep(sleepTime - get_idle_duration()) running = False else: if not running: running = True subprocess.Popen(['cmd.exe', '/c', bubbles])

This code working properly on my pc. Thank you anyway for this python code.