Add hyprstack config

This commit is contained in:
2024-07-06 12:59:14 +03:00
parent ead8c1df03
commit b820d657ee
32 changed files with 1417 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import socket
import os, os.path
def get_socket_path():
XDG_RUNTIME_DIR = os.getenv("XDG_RUNTIME_DIR")
HYPRLAND_INSTANCE_SIGNATURE = os.getenv("HYPRLAND_INSTANCE_SIGNATURE")
socket_path = os.path.join(
XDG_RUNTIME_DIR, "hypr", HYPRLAND_INSTANCE_SIGNATURE, ".socket2.sock"
)
return socket_path
def run_on_line(method):
server = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
server.connect(get_socket_path())
while True:
data_chunk = server.recv(4096)
if data_chunk:
line = data_chunk.decode("utf-8")
method(line)