47 lines
836 B
QML
47 lines
836 B
QML
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Io
|
|
|
|
ShellRoot {
|
|
id: shell
|
|
|
|
property bool open: false
|
|
|
|
Compositor {
|
|
id: compositor
|
|
niriScreenshots: theme.niriScreenshots
|
|
}
|
|
|
|
Theme {
|
|
id: theme
|
|
}
|
|
|
|
Component.onCompleted: {
|
|
if (compositor.kind === "")
|
|
console.warn("window-carousel: neither niri nor Hyprland was detected");
|
|
}
|
|
|
|
IpcHandler {
|
|
target: "windows"
|
|
|
|
function toggle(): void {
|
|
shell.open = !shell.open;
|
|
}
|
|
|
|
function open(): void {
|
|
shell.open = true;
|
|
}
|
|
|
|
function close(): void {
|
|
shell.open = false;
|
|
}
|
|
}
|
|
|
|
CarouselView {
|
|
shellOpen: shell.open
|
|
compositor: compositor
|
|
theme: theme
|
|
onRequestClose: shell.open = false
|
|
}
|
|
}
|