Skip to content

Commit

Permalink
Implement restart on display
Browse files Browse the repository at this point in the history
Implement restart on display connected/disconnected in hyprland (previously only worked in sway)
  • Loading branch information
pol-rivero committed Dec 28, 2024
1 parent 9468a79 commit a223ab7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nwg_panel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ def hypr_watcher():
# print(f"events: {event_names}")

for event_name in event_names:
if common_settings["restart-on-display"] and (event_name in ["monitoradded", "monitorremoved"]):
print("Received event '{}'; restart in {} ms.".format(event_name, common_settings["restart-delay"]))
GLib.timeout_add(common_settings["restart-delay"], restart, priority=GLib.PRIORITY_HIGH)

if event_name in ["activespecial",
"activewindow",
"activewindowv2",
Expand Down

0 comments on commit a223ab7

Please sign in to comment.