spi refactor

This commit is contained in:
Teo
2026-07-03 17:59:14 +02:00
parent 139ef3b4fd
commit 49e08f0093
3 changed files with 48 additions and 5 deletions
+44
View File
@@ -0,0 +1,44 @@
import QtQuick
import Quickshell
import Quickshell.Wayland
Variants {
id: root
// Automatically generates a trap for every connected monitor
model: Quickshell.screens
delegate: PanelWindow {
screen: modelData
// Force the panel window to take up the full screen real estate
anchors.top: true
anchors.bottom: true
anchors.left: true
anchors.right: true
// Push it to the background layer below normal windows
WlrLayershell.layer: WlrLayer.Background
WlrLayershell.namespace: "transparent-focus-trap"
// Keep it transparent so your current wallpaper shows right through
color: "transparent"
// The core trap mechanism
MouseArea {
anchors.fill: parent
hoverEnabled: true
// Having an active hover area on the background layer forces the
// Wayland compositor to shift cursor target focus to this surface
// the exact millisecond your mouse exits a tiled/floating window.
onEntered: {
console.log("DEBUG: Mouse entered background (Focus Trap Active)");
}
onExited: {
console.log("DEBUG: Mouse left background (Focusing on Window)");
}
}
}
}
+1 -5
View File
@@ -21,7 +21,7 @@ Item {
const title = Hyprland.activeToplevel?.title; const title = Hyprland.activeToplevel?.title;
if (!title) if (!title)
return qsTr("Desktop"); return qsTr("Desktop");
return title.split(/\s+[\-\u2013\u2014\|]\s+/).pop(); return title.split(/\s+[\-\u2013\u2014\|]\s+/).pop();q
} }
readonly property string appIcon: { readonly property string appIcon: {
@@ -29,10 +29,6 @@ Item {
let icon = AppsState.matchIcon(root.windowClass); let icon = AppsState.matchIcon(root.windowClass);
if (!icon) {
icon = AppsState.matchIcon(root.windowClass.toLowerCase());
}
if (!icon) { if (!icon) {
icon = AppsState.matchIcon(root.windowTitle); icon = AppsState.matchIcon(root.windowTitle);
} }
+3
View File
@@ -7,6 +7,7 @@ import "./modules/bar"
import "./modules/wp" import "./modules/wp"
import "./modules/wlogout" import "./modules/wlogout"
import "./modules/jl" import "./modules/jl"
import "./modules/background"
ShellRoot { ShellRoot {
id: root id: root
@@ -25,6 +26,8 @@ ShellRoot {
id : wlLoader id : wlLoader
} }
Background {}
function openWlogout() { function openWlogout() {
wlLoader.openWlogout() wlLoader.openWlogout()
} }