-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #294 from nwg-piotr/runtimedir
Support socket files moved to $XDG_RUNTIME_DIR/hypr
- Loading branch information
Showing
3 changed files
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: [email protected] | ||
GitHub: https://github.com/nwg-piotr/nwg-panel | ||
Project: https://nwg-piotr.github.io/nwg-shell | ||
|
@@ -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') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters