comments, messages

This commit is contained in:
piotr
2024-10-05 01:00:07 +02:00
parent 4c8fe7dcb0
commit 1345106637

View File

@@ -152,7 +152,6 @@ def restart():
subprocess.Popen(restart_cmd, shell=True) subprocess.Popen(restart_cmd, shell=True)
# read from Hyprland socket2 on async thread
def hypr_watcher(): def hypr_watcher():
import socket import socket
@@ -173,7 +172,7 @@ def hypr_watcher():
event_names = [] event_names = []
for line in lines: for line in lines:
event_names.append(line.split(">>")[0]) event_names.append(line.split(">>")[0])
print(event_names) # print(f"events: {event_names}")
for event_name in event_names: for event_name in event_names:
if event_name in ["activespecial", if event_name in ["activespecial",
@@ -194,7 +193,7 @@ def hypr_watcher():
just_refreshed = False just_refreshed = False
break break
print(f">>> Refreshing on {event_name}") # print(f">>> refreshing on {event_name}")
monitors, workspaces, clients, activewindow, activeworkspace = h_modules_get_all() monitors, workspaces, clients, activewindow, activeworkspace = h_modules_get_all()
for item in common.h_taskbars_list: for item in common.h_taskbars_list:
GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow) GLib.timeout_add(0, item.refresh, monitors, workspaces, clients, activewindow)
@@ -204,7 +203,6 @@ def hypr_watcher():
if event_name in ["createworkspace", "destroyworkspace", "focusedmon", "workspace"]: if event_name in ["createworkspace", "destroyworkspace", "focusedmon", "workspace"]:
just_refreshed = True just_refreshed = True
break break
@@ -854,6 +852,7 @@ def main():
if his: if his:
if len(common.h_taskbars_list) > 0 or len(common.h_workspaces_list) > 0: if len(common.h_taskbars_list) > 0 or len(common.h_workspaces_list) > 0:
print("his: '{}', starting hypr_watcher".format(his)) print("his: '{}', starting hypr_watcher".format(his))
# read from Hyprland socket2 on another thread
thread = threading.Thread(target=hypr_watcher) thread = threading.Thread(target=hypr_watcher)
thread.daemon = True thread.daemon = True
thread.start() thread.start()