New user-based concise daemon
This commit is contained in:
parent
dc896603c7
commit
dd9640587d
|
@ -1,12 +1,11 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
from evdev import InputDevice, categorize, ecodes
|
from evdev import InputDevice, categorize, ecodes
|
||||||
import configparser
|
import configparser, os
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read('config.ini')
|
config.read('config.ini')
|
||||||
def sysrun(command):
|
def sysrun(command):
|
||||||
f=open("lastCommand","w")
|
os.system(command+ " &")
|
||||||
f.write(command)
|
dev = InputDevice(config["DEVICE"]["path"])
|
||||||
f.close()
|
|
||||||
dev = InputDevice('/dev/input/by-id/usb-dakai_PS_2+USB_Keyboard-event-kbd')
|
|
||||||
dev.grab()
|
dev.grab()
|
||||||
for event in dev.read_loop():
|
for event in dev.read_loop():
|
||||||
if event.type == ecodes.EV_KEY:
|
if event.type == ecodes.EV_KEY:
|
Loading…
Reference in New Issue
Block a user