New user-based concise daemon

This commit is contained in:
Mattia Mascarello 2021-08-30 00:32:28 +02:00 committed by GitHub
parent dc896603c7
commit dd9640587d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,12 +1,11 @@
#!/usr/bin/python3
from evdev import InputDevice, categorize, ecodes
import configparser
import configparser, os
config = configparser.ConfigParser()
config.read('config.ini')
def sysrun(command):
f=open("lastCommand","w")
f.write(command)
f.close()
dev = InputDevice('/dev/input/by-id/usb-dakai_PS_2+USB_Keyboard-event-kbd')
os.system(command+ " &")
dev = InputDevice(config["DEVICE"]["path"])
dev.grab()
for event in dev.read_loop():
if event.type == ecodes.EV_KEY: