feat: initial commit
This commit is contained in:
parent
e37cb782a8
commit
c388d83dac
1 changed files with 17 additions and 0 deletions
17
caffeine.py
Normal file
17
caffeine.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env python3
|
||||
import time
|
||||
from datetime import datetime
|
||||
from pynput.keyboard import Controller, KeyCode
|
||||
|
||||
keyboard = Controller()
|
||||
count = 0
|
||||
|
||||
print("Caffeine iniciado. Ctrl+C para parar.\n")
|
||||
|
||||
while True:
|
||||
keyboard.press(KeyCode.from_vk(0x7F))
|
||||
time.sleep(0.05)
|
||||
keyboard.release(KeyCode.from_vk(0x7F))
|
||||
count += 1
|
||||
print(f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] F16 pressed #{count}")
|
||||
time.sleep(60)
|
||||
Loading…
Add table
Reference in a new issue