Files
homelab/dotfiles/quickshell/widgets/osd/VolumeOsd.qml
T
darmanandClaude Opus 5.5 760e353335 feat(titan): Zenbook laptop on a shared workstation profile
terra's desktop is split into profiles/workstation.nix (NixOS side) and
home/desktop/ (home-manager side, moved from hosts/terra/home*), so titan,
an ASUS Zenbook Pro Duo UX581 (Intel iGPU + RTX 2060 PRIME offload),
gets the same Hyprland workstation. Per-host monitors, primary/secondary
output and wallpaper are homelab.desktop.* options; the quickshell widgets
read the outputs from QS_PRIMARY_OUTPUT/QS_SECONDARY_OUTPUT instead of
hardcoding DP-2/HDMI-A-1. Folder icons come from a new HyprChrome-Folders
icon theme.

titan gets its own sops file and recipient. LibreChat is removed from
terra along with its secrets declarations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 11:33:03 +02:00

113 lines
2.7 KiB
QML

import Quickshell
import Quickshell.Services.Pipewire
import Quickshell.Wayland
import QtQuick
import qs.widgets.theme
Scope {
id: root
readonly property PwNode sink: Pipewire.defaultAudioSink
readonly property real volume: sink?.audio?.volume ?? 0
readonly property bool muted: sink?.audio?.muted ?? false
readonly property real maxVolume: 1.5
property bool active: false
PwObjectTracker {
objects: [root.sink]
}
Timer {
id: hideTimer
interval: 1500
onTriggered: root.active = false
}
Connections {
target: root.sink?.audio
function onVolumeChanged() {
root.active = true;
hideTimer.restart();
}
function onMutedChanged() {
root.active = true;
hideTimer.restart();
}
}
PanelWindow {
screen: Quickshell.screens.find(s => s.name === Quickshell.env("QS_PRIMARY_OUTPUT"))
visible: root.active
WlrLayershell.layer: WlrLayer.Overlay
exclusionMode: ExclusionMode.Ignore
color: "transparent"
anchors {
bottom: true
left: true
right: true
}
margins {
bottom: 30
left: 12
right: 12
}
implicitHeight: percentText.implicitHeight + 4 + bar.height
Text {
id: percentText
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: bar.top
anchors.bottomMargin: 4
text: Math.round(Math.min(root.volume, root.maxVolume) * 100) + "%"
color: !root.muted && root.volume > 1 ? Theme.hot : Theme.accent
font.pointSize: 12
font.bold: true
}
Item {
id: bar
anchors.bottom: parent.bottom
width: parent.width
height: 6
Rectangle {
anchors.centerIn: parent
implicitHeight: 6
width: parent.width * Math.min(root.volume, root.maxVolume) / root.maxVolume
color: Theme.hot
visible: !root.muted && root.volume > 1
Behavior on width {
NumberAnimation {
duration: 150
}
}
}
Rectangle {
anchors.centerIn: parent
implicitHeight: 6
width: parent.width * Math.min(root.volume, 1) / root.maxVolume
color: root.muted ? Theme.muted : Theme.accent
Behavior on width {
NumberAnimation {
duration: 150
}
}
}
}
}
}