From 83d5ba42f8a98fc0df177efef4333f74a0481f61 Mon Sep 17 00:00:00 2001 From: pants Date: Mon, 21 Sep 2026 14:18:06 -0700 Subject: init --- scripts/sockets.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 scripts/sockets.py (limited to 'scripts/sockets.py') diff --git a/scripts/sockets.py b/scripts/sockets.py new file mode 100644 index 0000000..802d5e6 --- /dev/null +++ b/scripts/sockets.py @@ -0,0 +1,32 @@ +import socket +import time +import os + +cmd1 = """ +{"action":"add","identifier":"preview","max_height":21,"max_width":118,"path":"/tmp/a.png","x":10,"y":15} +""" + +cmd2 = """ +{"action":"add","identifier":"preview","max_height":47,"max_width":118,"path":"/tmp/b.png","x":10,"y":15} +""" + +cmd_exit = """ +{"action":"remove","identifier":"preview"} +""" + +s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) +connected = False +while not connected: + try: + s.connect(f"/tmp/ueberzugpp-30468.socket") + connected = True + except Exception: + time.sleep(0.05) + +s.sendall(str.encode(cmd1 + "\n")) +time.sleep(2) +s.sendall(str.encode(cmd_exit + "\n")) +s.sendall(str.encode(cmd2 + "\n")) +time.sleep(2) +s.sendall(str.encode(cmd_exit + "\n")) +s.close() -- cgit v1.2.3