gr try adjust test.sh

master
Bel LaPointe 2022-04-13 06:59:22 -06:00
parent 5dca6be2b3
commit 711035dadf
2 changed files with 15 additions and 15 deletions

View File

@ -1,9 +1,12 @@
from Xlib.display import Display try:
from Xlib.ext.xtest import fake_input from Xlib.display import Display
from Xlib import X from Xlib.ext.xtest import fake_input
from os import environ from Xlib import X
_display = Display(environ['DISPLAY'])
except Exception:
pass
_display = Display(environ['DISPLAY']) from os import environ
def tap(keycode): def tap(keycode):
down(keycode) down(keycode)
@ -23,15 +26,17 @@ def up(keycode):
_display.sync() _display.sync()
def __init_keys__(): def __init_keys__():
import subprocess if environ.get("DRY"):
return {int(i):str(i) for i in range(12)}
import subprocess
_p = subprocess.run( _p = subprocess.run(
"xmodmap -pke".split(), "xmodmap -pke".split(),
capture_output=True, capture_output=True,
) )
assert(_p.returncode == 0) assert(_p.returncode == 0)
stdout = _p.stdout stdout = _p.stdout
result = {}
allowed = ["F"+str(i) for i in range(13, 25)] allowed = ["F"+str(i) for i in range(13, 25)]
result = {}
unassigned = [] unassigned = []
# already assigned # already assigned
for line in stdout.split("\n".encode())[1:]: for line in stdout.split("\n".encode())[1:]:

View File

@ -23,19 +23,14 @@ python3 ./state_to_buttons.py &
-b-min 1 \ -b-min 1 \
-b-max 10 \ -b-max 10 \
-d-min 100 \ -d-min 100 \
-d-max 3000 \ -d-max 1000 \
-between 100 \
-b-min 10 \
-b-max 100 \
-d-min 100 \
-d-max 3000 \
-between 10 \ -between 10 \
-w 3 \ -w 2 \
| peek \ | peek \
| python3 ./stream_to_state.py \ | python3 ./stream_to_state.py \
-n 1 \ -n 1 \
-m .25 \ -m .25 \
-r .1 -r .1
) & ) &
while true; do while true; do