X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=kiosk.py;h=a7350ec41b2ee3d1d2c779f764436ef146e270ec;hb=05d7c68eff68d919e1868463d6721acb896eacd9;hp=01b7949bdec216273527451b66faa44908f8fdbb;hpb=86f7e14f34b43ed8eb8cf5eaf113a4ecca976327;p=kiosk.git diff --git a/kiosk.py b/kiosk.py index 01b7949..a7350ec 100755 --- a/kiosk.py +++ b/kiosk.py @@ -19,10 +19,12 @@ import numpy as np import pvporcupine import pytz -import bootstrap -import config -import datetime_utils -import file_utils +from pyutils import ( + bootstrap, + config, +) +from pyutils.datetimes import datetime_utils +from pyutils.files import file_utils import kiosk_constants import file_writer @@ -131,6 +133,16 @@ def process_command(command: str, page_history: List[str], page_chooser) -> str: page = None if 'hold' in command: page = page_history[0] + elif 'down' in command: + os.system( + "xdotool search --onlyvisible \"chrom\" windowactivate click --repeat 8 5" + ) + return None + elif 'up' in command: + os.system( + "xdotool search --onlyvisible \"chrom\" windowactivate click --repeat 8 4" + ) + return None elif 'back' in command: page = page_history[1] elif 'skip' in command: @@ -238,8 +250,10 @@ def thread_change_current(command_queue: Queue) -> None: if command is not None: logger.info(f'chooser: We got a verbal command ("{command}"), parsing it...') - triggered = True page = process_command(command, page_history, page_chooser) + + if page: + triggered = True else: while True: (page, triggered) = page_chooser.choose_next_page()