From dd9640587d8243add82f403a2271d95ba2c6135a Mon Sep 17 00:00:00 2001 From: MatMasIt Date: Mon, 30 Aug 2021 00:32:28 +0200 Subject: [PATCH] New user-based concise daemon --- rootDaemon.py => hotcutdaemon.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) rename rootDaemon.py => hotcutdaemon.py (75%) diff --git a/rootDaemon.py b/hotcutdaemon.py similarity index 75% rename from rootDaemon.py rename to hotcutdaemon.py index 51c17b3..ff79e00 100644 --- a/rootDaemon.py +++ b/hotcutdaemon.py @@ -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: