Add terminal spawning quickshell config

This commit is contained in:
outfoxxed 2024-03-20 01:48:56 -07:00
parent 6a824b8a58
commit 8364a3b9b9
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
9 changed files with 308 additions and 72 deletions

View file

@ -0,0 +1,117 @@
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`]
}
Connections {
target: ShellIpc
function onTermSelectChanged() {
if (ShellIpc.termSelect) {
selectionLayer.selectionArea.startSelection();
} else {
selectionLayer.selectionArea.endSelection();
}
}
}
}
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
}
}
}
}
}
}