161 lines
2.7 KiB
QML
161 lines
2.7 KiB
QML
import Quickshell
|
|
import Quickshell.Io
|
|
import Quickshell.Wayland
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import ".."
|
|
import "screenshot" as Screenshot
|
|
import "bar" as Bar
|
|
|
|
ShellRoot {
|
|
Process {
|
|
command: ["mkdir", "-p", ShellGlobals.rtpath]
|
|
running: true
|
|
}
|
|
|
|
LazyLoader {
|
|
id: screenshot
|
|
loading: true
|
|
|
|
Screenshot.Controller {
|
|
}
|
|
}
|
|
|
|
Connections {
|
|
target: ShellIpc
|
|
|
|
function onScreenshot() {
|
|
screenshot.item.shooting = true;
|
|
}
|
|
}
|
|
|
|
Variants {
|
|
model: Quickshell.screens
|
|
|
|
Scope {
|
|
property var modelData
|
|
|
|
/*Bar {
|
|
screen: modelData
|
|
}*/
|
|
Bar.Bar {
|
|
screen: modelData
|
|
}
|
|
|
|
PanelWindow {
|
|
id: window
|
|
|
|
screen: modelData
|
|
WlrLayershell.layer: WlrLayer.Background
|
|
WlrLayershell.namespace: "shell:background"
|
|
|
|
anchors {
|
|
top: true
|
|
bottom: true
|
|
left: true
|
|
right: true
|
|
}
|
|
|
|
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 {
|
|
visible: false
|
|
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
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|