From 2385d4e635c6c21b9f7cc6421e2bdb87aba351d9 Mon Sep 17 00:00:00 2001 From: Ben Reaves Date: Tue, 30 Jul 2019 13:49:44 -0500 Subject: [PATCH] - Fix syntax error in install script, fixed bug in xactive where keyswap may not be trigger if process id was not exactly 7 integers long, it now accepts integers of any length. --- install.py | 2 +- system-config/xactive.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/install.py b/install.py index 270526c..7a86431 100755 --- a/install.py +++ b/install.py @@ -76,7 +76,7 @@ def keyboard_detect(): print("systemctl --user disable keyswap") print("rm -rf ~/.config/autostart/keyswap.sh") print("rm -rf ~/.config/xactive.sh") - keyswapcmd = '/bin/bash -c "./keyswap_service.sh 1 0 ' + system_type + ' ' + str(internalid).strip() + ' ' + str(usbid) + ' ' + chromeswap '"' + keyswapcmd = '/bin/bash -c "./keyswap_service.sh 1 0 ' + system_type + ' ' + str(internalid).strip() + ' ' + str(usbid).strip() + ' ' + str(chromeswap) + '"' print(keyswapcmd) subprocess.check_output(keyswapcmd, shell=True).decode('utf-8') else: diff --git a/system-config/xactive.sh b/system-config/xactive.sh index 8a76681..3addffa 100755 --- a/system-config/xactive.sh +++ b/system-config/xactive.sh @@ -38,7 +38,7 @@ echo "$systemtype $swapbehavior" echo "$swapcmd_gui" # regex for extracting hex id's -grep_id='0[xX][a-zA-Z0-9]\{7\}' +grep_id='0[xX][a-zA-Z0-9]\+' #Storing timestamp and will use timediff to prevent xprop duplicates timestp=$(date +%s) @@ -53,6 +53,7 @@ while read -r id; do # Set keymap for terminal, Alt is Super, Ctrl is Ctrl, Super is Alt if [[ $internalid -gt 0 ]]; then eval "$check_gt" + echo $? if [ $? -eq 0 ]; then echo "internal gui to term" eval "$swapcmd_term" @@ -70,6 +71,7 @@ while read -r id; do # Set keymap for gui, Alt is Ctrl,Super is Alt, Ctrl is Super if [[ $internalid -gt 0 ]]; then eval "$check_tg" + echo $? if [ $? -eq 0 ]; then echo "internal term to gui" eval "$swapcmd_gui"