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':