nixos/config/quickshell/shell.qml

107 lines
1.8 KiB
QML
Raw Normal View History

2025-01-07 22:37:12 +04:00
import Quickshell
import Quickshell.Io
2025-01-08 11:17:54 +04:00
import Quickshell.Hyprland
2025-01-07 22:37:12 +04:00
import QtQuick
2025-01-08 11:17:54 +04:00
import QtQuick.Layouts
2025-01-07 22:37:12 +04:00
2025-01-09 13:42:16 +04:00
// thanks ImNotTwig for giving me your shell.qml as reference
2025-01-07 22:37:12 +04:00
ShellRoot {
2025-01-10 19:52:14 +04:00
id: root
2025-01-07 22:37:12 +04:00
ReloadPopup {}
property string time;
Variants {
model: Quickshell.screens
PanelWindow {
2025-01-09 13:42:16 +04:00
property var modelData
2025-01-09 23:04:06 +04:00
property var workspaceArray: Array.from({ length: 10 }, (_, i) => ({
id: i + 1,
text: i + 1,
visible: Hyprland.workspaces.values.some(e => e.id === i + 1),
active: Hyprland.focusedMonitor.activeWorkspace.id === i + 1
}))
2025-01-09 13:42:16 +04:00
width: 70
2025-01-09 23:04:06 +04:00
color: "#222222"
2025-01-07 22:37:12 +04:00
screen: modelData
2025-01-10 18:37:18 +04:00
margins {
top: 10
bottom: 10
left: 10
}
2025-01-07 22:37:12 +04:00
anchors {
top: true;
2025-01-09 15:44:06 +04:00
bottom: true;
2025-01-08 11:17:54 +04:00
left: true;
/* right: true; */
2025-01-07 22:37:12 +04:00
}
2025-01-08 11:17:54 +04:00
height: 30;
2025-01-08 08:29:37 +04:00
2025-01-10 19:52:14 +04:00
// top
ColumnLayout {
/* anchors.left: parent.left */
2025-01-08 11:17:54 +04:00
anchors.top: parent.top
/* anchors.bottom: parent.bottom */
anchors.topMargin: 5;
spacing: 5
2025-01-09 23:04:06 +04:00
Workspaces {}
2025-01-08 11:17:54 +04:00
}
// Center
2025-01-10 19:52:14 +04:00
ColumnLayout {
/* anchors.centerIn: parent */
/* Text { */
/* color: "#FFFFFF" */
/* // now just time instead of root.time */
/* text: time */
/* } */
2025-01-08 11:17:54 +04:00
}
2025-01-10 19:52:14 +04:00
// bottom
ColumnLayout {
2025-01-08 11:17:54 +04:00
anchors.bottom: parent.bottom
2025-01-10 19:52:14 +04:00
anchors.horizontalCenter: parent.horizontalCenter
2025-01-10 18:37:18 +04:00
/* spacing: 5 */
2025-01-10 19:52:14 +04:00
2025-01-10 16:00:43 +04:00
Battery { }
2025-01-10 19:52:14 +04:00
/* Date {} */
Time {}
2025-01-08 11:17:54 +04:00
}
2025-01-07 22:37:12 +04:00
}
}
2025-01-10 19:52:14 +04:00
/* Process { */
/* id: dateProc */
/* command: ["date", "+%m %d"] */
/* running: true */
2025-01-07 22:37:12 +04:00
2025-01-10 19:52:14 +04:00
/* stdout: SplitParser { */
/* // now just time instead of root.time */
/* onRead: data => time = data */
/* } */
/* } */
2025-01-07 22:37:12 +04:00
Timer {
interval: 1000
running: true
repeat: true
onTriggered: dateProc.running = true
}
}