nixnew/modules/user/modules/quickshell/shell/shell.qml

131 lines
2.3 KiB
QML

import Quickshell
import Quickshell.Io
import Quickshell.Wayland
import QtQuick
import QtQuick.Layouts
import ".."
ShellRoot {
Variants {
model: Quickshell.screens
Scope {
property var modelData
PanelWindow {
id: window
screen: modelData
WlrLayershell.layer: WlrLayer.Background
anchors {
top: true
bottom: true
left: true
right: true
}
color: "#111111"
BackgroundImage {
anchors.fill: parent
screen: window.screen
}
SelectionLayer {
id: selectionLayer
onSelectionComplete: (x, y, width, height) => {
console.log(`selection complete: ${x} ${y} ${width} ${height}`)
termSpawner.x = x
termSpawner.y = y
termSpawner.width = width
termSpawner.height = height
termSpawner.running = true
}
Process {
id: termSpawner
property real x;
property real y;
property real width;
property real height;
command: [
"hyprctl",
"dispatch",
"exec",
`[float;; noanim; move ${x} ${y}; size ${width} ${height}] alacritty --class AlacrittyTermselect`
]
}
Connections {
target: ShellIpc
function onTermSelectChanged() {
if (ShellIpc.termSelect) {
selectionLayer.selectionArea.startSelection(true);
} else {
selectionLayer.selectionArea.endSelection();
}
}
}
Connections {
target: HyprlandIpc
function onWindowOpened(_, _, klass, _) {
if (klass == "AlacrittyTermselect") {
selectionLayer.selectionArea.selecting = false
}
}
}
}
SelectionArea {
anchors.fill: parent
screen: window.screen
selectionArea: selectionLayer.selectionArea
}
}
PanelWindow {
screen: modelData
WlrLayershell.layer: WlrLayer.Overlay
anchors {
right: true
bottom: true
}
margins {
right: 50
bottom: 50
}
width: content.width
height: content.height
color: "transparent"
mask: Region {}
ColumnLayout {
id: content
Text {
text: "Activate Linux"
color: "#50ffffff"
font.pointSize: 22
}
Text {
text: "Go to Settings to activate Linux"
color: "#50ffffff"
font.pointSize: 14
}
}
}
}
}
}