From cb0661c28747e69810d1a186e4fc11abbaa1eeed Mon Sep 17 00:00:00 2001 From: Maurice Kraus Date: Mon, 18 Sep 2023 21:15:21 +0200 Subject: [PATCH] add: monitor-added and monitor-removed signals to Hyprland service (#98) --- src/service/hyprland.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/service/hyprland.ts b/src/service/hyprland.ts index ebc6c7a..e1eff31 100644 --- a/src/service/hyprland.ts +++ b/src/service/hyprland.ts @@ -24,6 +24,8 @@ class HyprlandService extends Service { 'urgent-window': ['string'], 'submap': ['string'], 'keyboard-layout': ['string', 'string'], + 'monitor-added': ['string'], + 'monitor-removed': ['string'], }); } @@ -149,9 +151,17 @@ class HyprlandService extends Service { switch (e) { case 'workspace': case 'focusedmon': + await this._syncMonitors(); + break; + case 'monitorremoved': + await this._syncMonitors(); + this.emit('monitor-removed', argv[0]); + break; + case 'monitoradded': await this._syncMonitors(); + this.emit('monitor-added', argv[0]); break; case 'createworkspace':