lastfm-qtiles-background/tap_in.py

24 lines
616 B
Python
Raw Permalink Normal View History

import sys
import time
import pyautogui
print("Arguments received:", sys.argv)
def write_color_to_file(color):
with open("/tmp/bar_color.txt", "w") as f:
f.write(color)
print(f"Successfully wrote color {color} to /tmp/bar_color.txt")
def simulate_f7_keypress():
time.sleep(1) # Give a little time for the file to be written
pyautogui.press('f7')
print("Simulated F7 keypress")
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: python tap_in.py <color>")
else:
color = sys.argv[1]
write_color_to_file(color)
simulate_f7_keypress()