add: monitor-added and monitor-removed signals to Hyprland service (#98)

This commit is contained in:
Maurice Kraus
2023-09-18 21:15:21 +02:00
committed by GitHub
parent 0c22b0bc9a
commit cb0661c287
+10
View File
@@ -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':