0
trickyni trickyniv56@gmail.com
Thu, 09 Oct 2025 14:18:01 +0300
4 files changed,
71 insertions(+),
74 deletions(-)
M
bar/Bar.qml
→
bar/Bar.qml
@@ -11,7 +11,7 @@ TopBar {
TopbarRight { Module.Timedate {} Module.Sunset {} - Module.OldVolume {} + Module.Volume {} Module.Moonphase {} Module.Ram {} Module.Taskwarrior {}
D
bar/modules/OldVolume.qml
@@ -1,48 +0,0 @@
-import QtQuick -import Quickshell -import QtQuick.Controls.Basic -import QtQuick.Layouts -import Quickshell.Services.Pipewire -import "../classes" as Class -import "../../" - -Button { - PwObjectTracker { - objects: [ Pipewire.defaultAudioSink ] - } - property var muted: Pipewire.defaultAudioSink?.audio.muted - padding: 0 - background: Rectangle { - color: Resources.palette.bg - } -contentItem: Class.RightRowLayout { - id: volume_module - Layout.alignment: Qt.AlignVCenter - Class.TopbarText { - id: volume_indicator - property var vol: Math.round((Pipewire.defaultAudioSink?.audio.volume ?? 0) * 100) - text: - (muted) - ? "" - : vol + "%" - color: Resources.palette.fg - } - Class.TopbarIcon { - text: muted - ? "" - : (volume_indicator.vol == 0) - ? "" - : (volume_indicator.vol <= 50) - ? "" - : (volume_indicator.vol > 50) - ? "" - : Icons.volume.low - color: muted - ? Resources.palette.scarlet - : Resources.palette.orange - anchors.verticalCenter: parent - } - Class.TopSep{} - } -} -
A
bar/modules/SVG_Volume.qml
@@ -0,0 +1,42 @@
+// Volume.qml +import QtQuick +import Quickshell +import QtQuick.Controls.Basic +import QtQuick.Layouts +import Quickshell.Services.Pipewire +import "../classes" as Class +import "../../" + +Class.RightRowLayout { + spacing:2 + PwObjectTracker { + objects: [ Pipewire.defaultAudioSink ] + } + property var muted: Pipewire.defaultAudioSink?.audio.muted + Class.TopbarText { + id: volume_indicator + property var vol: Math.round((Pipewire.defaultAudioSink?.audio.volume ?? 0) * 100) + text: (muted) + ? "" + : vol + "%" + } + Class.TopbarSVG { + icon.source: muted + ? "../../icons/phosphor/light/speaker-x-light.svg" + : (volume_indicator.vol == 0) + ? "../../icons/phosphor/light/speaker-none-light.svg" + : (volume_indicator.vol <= 50) + ? "../../icons/phosphor/light/speaker-low-light.svg" + : (volume_indicator.vol > 50) + ? "../../icons/phosphor/light/speaker-high-light.svg" + : "../../icons/phosphor/light/speaker-low-light.svg" + + icon.color: muted + ? Resources.palette.scarlet + : Resources.palette.orange + + icon.width: Resources.fontsize.topbar_text-1 + icon.height: Resources.fontsize.topbar_text-1 + } + Class.TopSep{} + }
M
bar/modules/Volume.qml
→
bar/modules/Volume.qml
@@ -1,4 +1,3 @@
-// Volume.qml import QtQuick import Quickshell import QtQuick.Controls.Basic@@ -8,36 +7,40 @@ import "../classes" as Class
import "../../" Class.RightRowLayout { - spacing:2 - PwObjectTracker { - objects: [ Pipewire.defaultAudioSink ] - } - property var muted: Pipewire.defaultAudioSink?.audio.muted - - Class.TopbarText { + PwObjectTracker { + objects: [ Pipewire.defaultAudioSink ] + } + property var muted: Pipewire.defaultAudioSink?.audio.muted + Rectangle { + color: Resources.palette.bg + } +Class.RightRowLayout { + id: volume_module + Layout.alignment: Qt.AlignVCenter + Class.TopbarText { id: volume_indicator property var vol: Math.round((Pipewire.defaultAudioSink?.audio.volume ?? 0) * 100) - text: (muted) - ? "" + text: (muted) + ? "" : vol + "%" - } - Class.TopbarSVG { - icon.source: muted - ? "../../icons/phosphor/light/speaker-x-light.svg" + color: Resources.palette.fg + } + Class.TopbarIcon { + text: (muted) + ? "" : (volume_indicator.vol == 0) - ? "../../icons/phosphor/light/speaker-none-light.svg" + ? "" : (volume_indicator.vol <= 50) - ? "../../icons/phosphor/light/speaker-low-light.svg" + ? "" : (volume_indicator.vol > 50) - ? "../../icons/phosphor/light/speaker-high-light.svg" - : "../../icons/phosphor/light/speaker-low-light.svg" - - icon.color: muted + ? "" + : Icons.volume.low + color: (muted) ? Resources.palette.scarlet : Resources.palette.orange + anchors.verticalCenter: parent + } + Class.TopSep{} + } +} - icon.width: Resources.fontsize.topbar_text-1 - icon.height: Resources.fontsize.topbar_text-1 - } - Class.TopSep{} - }