Add homemonitor script

This commit is contained in:
Tanner Collin 2023-11-12 14:46:51 -07:00
parent 78ae4b92ae
commit 6aa6929574
2 changed files with 30 additions and 0 deletions

20
homemonitor.py Normal file
View File

@ -0,0 +1,20 @@
# This script monitors Protovac's HOME key to kick the user
# back to the home screen
#
# Runs as root
import os
import serial
ser = serial.Serial('/dev/ttyAMA1', baudrate=9600)
try:
while True:
if ser.read() == b'\x01' and ser.read() == b'N' and ser.read() == b'\r':
print('Home key pressed, killing login process...')
os.system('killall -9 login')
finally:
print('Closing serial port...')
ser.close()

View File

@ -1,9 +1,19 @@
annotated-types==0.5.0
certifi==2022.6.15 certifi==2022.6.15
charset-normalizer==2.1.1 charset-normalizer==2.1.1
idna==3.3 idna==3.3
inflect==7.0.0
jaraco.itertools==6.4.1
more-itertools==9.1.0
Pillow==9.2.0 Pillow==9.2.0
pydantic==2.0.3
pydantic_core==2.3.0
pyserial==3.5
pytz==2022.2.1 pytz==2022.2.1
requests==2.28.1 requests==2.28.1
six==1.16.0
typing_extensions==4.7.1
urllib3==1.26.12 urllib3==1.26.12
git+https://git.tannercollin.com/tanner/wolframalpha.git git+https://git.tannercollin.com/tanner/wolframalpha.git
x256==0.0.3 x256==0.0.3
xmltodict==0.13.0