mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-31 17:02:51 -05:00
niri: add window-rule management
- settings UI for creating, editing, deleting window ruels - IPC to create a window rule for the currently focused toplevel fixes #1292
This commit is contained in:
@@ -64,11 +64,18 @@ Popup {
|
||||
return actions;
|
||||
}
|
||||
|
||||
function executePluginAction(actionFunc) {
|
||||
if (typeof actionFunc === "function") {
|
||||
function executePluginAction(actionOrObj) {
|
||||
var actionFunc = typeof actionOrObj === "function" ? actionOrObj : actionOrObj?.action;
|
||||
var closeLauncher = typeof actionOrObj === "object" && actionOrObj?.closeLauncher;
|
||||
|
||||
if (typeof actionFunc === "function")
|
||||
actionFunc();
|
||||
|
||||
if (closeLauncher) {
|
||||
controller?.itemExecuted();
|
||||
} else {
|
||||
controller?.performSearch();
|
||||
}
|
||||
controller?.performSearch();
|
||||
hide();
|
||||
}
|
||||
|
||||
@@ -83,7 +90,7 @@ Popup {
|
||||
type: "item",
|
||||
icon: act.icon || "play_arrow",
|
||||
text: act.text || act.name || "",
|
||||
pluginAction: act.action
|
||||
pluginAction: act
|
||||
});
|
||||
}
|
||||
return items;
|
||||
|
||||
@@ -441,5 +441,22 @@ FocusScope {
|
||||
Qt.callLater(() => item.forceActiveFocus());
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: windowRulesLoader
|
||||
anchors.fill: parent
|
||||
active: root.currentIndex === 28
|
||||
visible: active
|
||||
focus: active
|
||||
|
||||
sourceComponent: WindowRulesTab {
|
||||
parentModal: root.parentModal
|
||||
}
|
||||
|
||||
onActiveChanged: {
|
||||
if (active && item)
|
||||
Qt.callLater(() => item.forceActiveFocus());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,6 +252,13 @@ Rectangle {
|
||||
"icon": "content_paste",
|
||||
"tabIndex": 23,
|
||||
"clipboardOnly": true
|
||||
},
|
||||
{
|
||||
"id": "window_rules",
|
||||
"text": I18n.tr("Window Rules"),
|
||||
"icon": "select_window",
|
||||
"tabIndex": 28,
|
||||
"niriOnly": true
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -304,6 +311,8 @@ Rectangle {
|
||||
return false;
|
||||
if (item.hyprlandNiriOnly && !CompositorService.isNiri && !CompositorService.isHyprland)
|
||||
return false;
|
||||
if (item.niriOnly && !CompositorService.isNiri)
|
||||
return false;
|
||||
if (item.clipboardOnly && (!DMSService.isConnected || DMSService.apiVersion < 23))
|
||||
return false;
|
||||
return true;
|
||||
|
||||
1143
quickshell/Modals/WindowRuleModal.qml
Normal file
1143
quickshell/Modals/WindowRuleModal.qml
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user