From 0fd1c52495447c6db0e8e6795978696151b27658 Mon Sep 17 00:00:00 2001 From: piotr Date: Wed, 1 May 2024 01:02:55 +0200 Subject: [PATCH 1/3] support sockets moved to $XDG_RUNTIME_DIR/hypr #290 --- nwg_panel/main.py | 6 +++++- nwg_panel/processes.py | 6 +++++- nwg_panel/tools.py | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/nwg_panel/main.py b/nwg_panel/main.py index 9d52c504..5cea821a 100644 --- a/nwg_panel/main.py +++ b/nwg_panel/main.py @@ -158,8 +158,12 @@ def restart(): def hypr_watcher(): import socket + # /tmp/hypr moved to $XDG_RUNTIME_DIR/hypr in #5788 + hypr_dir = f"{os.getenv("XDG_RUNTIME_DIR")}/hypr" if os.path.isdir( + f"{os.getenv("XDG_RUNTIME_DIR")}/hypr") else "/tmp/hypr" + client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) - client.connect("/tmp/hypr/{}/.socket2.sock".format(his)) + client.connect(f"{hypr_dir}/{his}/.socket2.sock") global last_client_addr, last_client_title client_addr, client_title = None, None diff --git a/nwg_panel/processes.py b/nwg_panel/processes.py index 0c9b66bd..45facf9a 100644 --- a/nwg_panel/processes.py +++ b/nwg_panel/processes.py @@ -45,8 +45,12 @@ class SortOrder(Enum): def hyprctl(cmd): + # /tmp/hypr moved to $XDG_RUNTIME_DIR/hypr in #5788 + hypr_dir = f"{os.getenv("XDG_RUNTIME_DIR")}/hypr" if os.path.isdir( + f"{os.getenv("XDG_RUNTIME_DIR")}/hypr") else "/tmp/hypr" + s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) - s.connect("/tmp/hypr/{}/.socket.sock".format(os.getenv("HYPRLAND_INSTANCE_SIGNATURE"))) + s.connect(f"{hypr_dir}/{os.getenv("HYPRLAND_INSTANCE_SIGNATURE")}/.socket.sock") s.send(cmd.encode("utf-8")) output = s.recv(20480).decode('utf-8') diff --git a/nwg_panel/tools.py b/nwg_panel/tools.py index 98b5fbdd..9380e8e3 100644 --- a/nwg_panel/tools.py +++ b/nwg_panel/tools.py @@ -820,9 +820,13 @@ def load_shell_data(): def hyprctl(cmd, buf_size=2048): + # /tmp/hypr moved to $XDG_RUNTIME_DIR/hypr in #5788 + hypr_dir = f"{os.getenv("XDG_RUNTIME_DIR")}/hypr" if os.path.isdir( + f"{os.getenv("XDG_RUNTIME_DIR")}/hypr") else "/tmp/hypr" + s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) try: - s.connect("/tmp/hypr/{}/.socket.sock".format(os.getenv("HYPRLAND_INSTANCE_SIGNATURE"))) + s.connect(f"{hypr_dir}/{os.getenv("HYPRLAND_INSTANCE_SIGNATURE")}/.socket.sock") s.send(cmd.encode("utf-8")) output = b"" From 702b1e9115a564baaa1bfdc61db18a08bf94204e Mon Sep 17 00:00:00 2001 From: piotr Date: Wed, 1 May 2024 01:07:16 +0200 Subject: [PATCH 2/3] bump to 0.9.29 --- nwg_panel/processes.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nwg_panel/processes.py b/nwg_panel/processes.py index 45facf9a..83edbb9c 100644 --- a/nwg_panel/processes.py +++ b/nwg_panel/processes.py @@ -2,7 +2,7 @@ """ nwg-shell helper script to preview system processes -Copyright (c) 2023 Piotr Miller +Copyright (c) 2023-2024 Piotr Miller e-mail: nwg.piotr@gmail.com GitHub: https://github.com/nwg-piotr/nwg-panel Project: https://nwg-piotr.github.io/nwg-shell diff --git a/setup.py b/setup.py index 053852ad..b1d1342b 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ def read(f_name): setup( name='nwg-panel', - version='0.9.28', + version='0.9.29', description='GTK3-based panel for sway and Hyprland Wayland compositors', packages=find_packages(), include_package_data=True, From da5273f01bc8144c27ded51a4381bcd4207e166f Mon Sep 17 00:00:00 2001 From: piotr Date: Wed, 1 May 2024 01:16:09 +0200 Subject: [PATCH 3/3] undo premature version bump --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b1d1342b..053852ad 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ def read(f_name): setup( name='nwg-panel', - version='0.9.29', + version='0.9.28', description='GTK3-based panel for sway and Hyprland Wayland compositors', packages=find_packages(), include_package_data=True,