Files
linux-dotfiles/quickshell/ui/TopBar.qml
2026-04-07 23:48:02 +02:00

94 lines
1.7 KiB
QML

pragma ComponentBehavior: Bound
import Quickshell
import Quickshell.Wayland
import Quickshell.Hyprland
import Quickshell.Io
import QtQuick
import QtQuick.Layouts
import "../constants"
import "../helpers"
import "."
Item {
id: root
property int cpuUsage: 0
property int memUsage: 0
property int gpuUsage: 0
property string nowPlayingArtist: ""
property string nowPlayingTitle: ""
property string nowPlayingArtUrl: ""
RowLayout {
anchors.fill: parent
// anchors.centerIn: verticalCenter
anchors.leftMargin: 8
anchors.rightMargin: 8
WorkspaceHelpers {
id: workspaceHelpers
}
WorkspacesList {
id: workspacesList
}
// small spacer
Item {
anchors.leftMargin: 10
}
NowPlaying {
artist: root.nowPlayingArtist
title: root.nowPlayingTitle
artUrl: root.nowPlayingArtUrl
}
// Spacer
Item {
Layout.fillWidth: true
}
// =====================
// RIGHT: System info
// =====================
RowLayout {
spacing: 10
LineSeparator {}
BluetoothIcon {}
LineSeparator {}
BarText {
prefix: "C"
value: cpuUsage
}
LineSeparator {}
BarText {
prefix: "M"
value: memUsage
}
LineSeparator {}
BarText {
prefix: "G"
value: gpuUsage
}
LineSeparator {}
LineSeparator {}
Clock {}
}
}
}