upd
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Services.Pipewire
|
||||
|
||||
import "Topbar"
|
||||
|
||||
PanelWindow {
|
||||
id: topbarWindow
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
left: true
|
||||
@@ -25,7 +30,82 @@ PanelWindow {
|
||||
implicitHeight: 182
|
||||
color: "#000000"
|
||||
|
||||
readonly property var focusedWorkspace: Hyprland.focusedWorkspace
|
||||
readonly property string workspaceLabel: {
|
||||
if (!focusedWorkspace)
|
||||
return "WS --";
|
||||
|
||||
if (focusedWorkspace.id >= 0)
|
||||
return "WS " + focusedWorkspace.id;
|
||||
|
||||
return "WS " + String(focusedWorkspace.name || "--");
|
||||
}
|
||||
|
||||
readonly property var defaultSink: Pipewire.defaultAudioSink
|
||||
readonly property string volumeLabel: {
|
||||
if (!defaultSink || !defaultSink.audio)
|
||||
return "VOL --";
|
||||
|
||||
if (defaultSink.audio.muted)
|
||||
return "VOL MUTE";
|
||||
|
||||
return "VOL " + Math.round(defaultSink.audio.volume * 100) + "%";
|
||||
}
|
||||
|
||||
PwObjectTracker {
|
||||
objects: [Pipewire.defaultAudioSink]
|
||||
}
|
||||
|
||||
SystemClock {
|
||||
id: clock
|
||||
precision: SystemClock.Minutes
|
||||
}
|
||||
|
||||
Topbar {
|
||||
manager: ShellStateManager
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 18
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 10
|
||||
color: "#ffffff"
|
||||
text: topbarWindow.workspaceLabel
|
||||
font.pixelSize: 36
|
||||
antialiasing: false
|
||||
font.family: "8bitoperator JVE"
|
||||
renderType: Text.NativeRendering
|
||||
font.hintingPreference: Font.PreferNoHinting
|
||||
}
|
||||
|
||||
Column {
|
||||
spacing: 2
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 18
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 10
|
||||
|
||||
Text {
|
||||
anchors.right: parent.right
|
||||
color: "#ffffff"
|
||||
text: topbarWindow.volumeLabel
|
||||
font.pixelSize: 36
|
||||
antialiasing: false
|
||||
font.family: "8bitoperator JVE"
|
||||
renderType: Text.NativeRendering
|
||||
font.hintingPreference: Font.PreferNoHinting
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.right: parent.right
|
||||
color: "#ffffff"
|
||||
text: Qt.formatTime(clock.date, "hh:mm")
|
||||
font.pixelSize: 36
|
||||
antialiasing: false
|
||||
font.family: "8bitoperator JVE"
|
||||
renderType: Text.NativeRendering
|
||||
font.hintingPreference: Font.PreferNoHinting
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user