Add homemonitor script
This commit is contained in:
parent
78ae4b92ae
commit
6aa6929574
20
homemonitor.py
Normal file
20
homemonitor.py
Normal 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()
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user