-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwall.py
33 lines (29 loc) · 1.11 KB
/
wall.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#################################################################
# Title: wall.py
# Author: Sahaj Sarup
# Copyright (c) 2018 Linaro Limited
#################################################################
from evdev import InputDevice, categorize, ecodes
import evdev
import time
import subprocess as sub
timeout = 5
touchdev = 'WaveShare WaveShare Touchscreen'
def touch(dev):
start = 0
for event in dev.read_loop():
if str(evdev.categorize(event))[-1] == 'p':
print("Hello")
sub.call('sudo pkill fbi', shell=True)
time.sleep(10)
sub.call('fbi -d /dev/fb0 -T 1 -a ./images/* -t ' + timeout + ' -u', shell=True)
if __name__=="__main__":
devices = [evdev.InputDevice(path) for path in evdev.list_devices()]
sub.call('startx ./wall-calendar.sh &', shell=True)
time.sleep(10)
sub.call('fbi -d /dev/fb0 -T 1 -a ./images/* -t ' + timeout + ' -u', shell=True)
for device in devices:
print(device.path, device.name, device.phys)
if(device.name == touchdev):
dev = InputDevice(device.path)
touch(dev)