Luigit
repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by admin

pi/agent/skills/optional/quickshell/examples/02-per-monitor-bar/Bar.qml

Raw
// 02-per-monitor-bar/Bar.qml
// The bar component. Imported from shell.qml with `import "."`.

import QtQuick
import QtQuick.Layouts
import Quickshell

PanelWindow {
    id: bar

    // Anchored to top, full-width.
    anchors {
        top: true
        left: true
        right: true
    }
    implicitHeight: 32
    color: "#cc1e1e2e"

    // The screen is set by the Variants delegate in shell.qml.

    // Instantiate the clock; precision defaults to Seconds.
    SystemClock {
        id: clock
        precision: SystemClock.Seconds
    }

    Row {
        anchors.fill: parent
        anchors.leftMargin: 12
        anchors.rightMargin: 12
        spacing: 16

        // Left side: workspace label (just static here; see Hyprland example for live).
        Text {
            text: "Bar"
            color: "white"
            font.pointSize: 11
            anchors.verticalCenter: parent.verticalCenter
        }

        Item { width: 1 } // spacer; the Row stretches

        // Right side: a clock. Uses Qt.formatDateTime for formatting.
        Text {
            text: Qt.formatDateTime(clock.date, "yyyy-MM-dd  hh:mm:ss")
            color: "white"
            font.pointSize: 11
            anchors.verticalCenter: parent.verticalCenter
        }
    }
}