Implemented trezor-restore feature and fixed tmux-buttons bug

This commit is contained in:
Sun Knudsen 2021-04-22 09:33:45 -04:00
parent 1aa5bc79b1
commit 943c893a6f
No known key found for this signature in database
GPG key ID: 1FA767862BBD1305
7 changed files with 194 additions and 74 deletions

View file

@ -1,5 +1,5 @@
import RPi.GPIO as GPIO
import keyboard
import subprocess
import time
GPIO.setmode(GPIO.BCM)
@ -10,13 +10,14 @@ GPIO.setup(23, GPIO.IN, pull_up_down = GPIO.PUD_UP)
def click(channel):
if channel == 17:
keyboard.send("ctrl+b, up")
subprocess.run(["tmux", "select-pane", "-t", "0"])
elif channel == 22:
keyboard.send("ctrl+b, down")
subprocess.run(["tmux", "select-pane", "-t", "1"])
elif channel == 23:
keyboard.send("ctrl+b, shift+7")
subprocess.run(["tmux", "kill-session"])
# elif channel == 27:
# keyboard.send("")
# subprocess.run(["tmux"])
GPIO.add_event_detect(17, GPIO.RISING, callback=click, bouncetime=300)
GPIO.add_event_detect(22, GPIO.RISING, callback=click, bouncetime=300)
GPIO.add_event_detect(23, GPIO.RISING, callback=click, bouncetime=300)