@@ -19,7 +19,8 @@ Variants {
1919 Volume,
2020 InputVolume,
2121 Brightness,
22- LockKey
22+ LockKey,
23+ MediaVolume
2324 }
2425
2526 model: Quickshell .screens .filter (screen => (Settings .data .osd .monitors .includes (screen .name ) || Settings .data .osd .monitors .length === 0 ) && Settings .data .osd .enabled )
@@ -45,6 +46,7 @@ Variants {
4546 readonly property bool isMuted: AudioService .muted
4647 readonly property real currentInputVolume: AudioService .inputVolume
4748 readonly property bool isInputMuted: AudioService .inputMuted
49+ readonly property real currentMediaVolume: MediaService .volume
4850 readonly property real epsilon: 0.005
4951
5052 // LockKey OSD enabled state (reactive to settings)
@@ -72,6 +74,11 @@ Variants {
7274 return currentVolume <= 0.5 ? " volume-low" : " volume-high" ;
7375 case OSD .Type .InputVolume :
7476 return isInputMuted ? " microphone-off" : " microphone" ;
77+ case OSD .Type .MediaVolume :
78+ // Show volume-x icon when volume is effectively 0% (within rounding threshold)
79+ if (currentMediaVolume < root .epsilon )
80+ return " volume-x" ;
81+ return currentMediaVolume <= 0.5 ? " volume-low" : " volume-high" ;
7582 case OSD .Type .Brightness :
7683 // Show sun-off icon when brightness is effectively 0% (within rounding threshold)
7784 if (currentBrightness < root .epsilon )
@@ -90,6 +97,8 @@ Variants {
9097 return isMuted ? 0 : currentVolume;
9198 case OSD .Type .InputVolume :
9299 return isInputMuted ? 0 : currentInputVolume;
100+ case OSD .Type .MediaVolume :
101+ return currentMediaVolume;
93102 case OSD .Type .Brightness :
94103 return currentBrightness;
95104 case OSD .Type .LockKey :
@@ -124,7 +133,7 @@ Variants {
124133 }
125134
126135 function getProgressColor () {
127- const isMutedState = (currentOSDType === OSD .Type .Volume && isMuted) || (currentOSDType === OSD .Type .InputVolume && isInputMuted);
136+ const isMutedState = (currentOSDType === OSD .Type .Volume && isMuted) || (currentOSDType === OSD .Type .InputVolume && isInputMuted) || (currentOSDType === OSD . Type . MediaVolume && currentMediaVolume < root . epsilon ) ;
128137 if (isMutedState) {
129138 return Color .mError ;
130139 }
@@ -150,7 +159,7 @@ Variants {
150159 }
151160
152161 function getIconColor () {
153- const isMutedState = (currentOSDType === OSD .Type .Volume && isMuted) || (currentOSDType === OSD .Type .InputVolume && isInputMuted);
162+ const isMutedState = (currentOSDType === OSD .Type .Volume && isMuted) || (currentOSDType === OSD .Type .InputVolume && isInputMuted) || (currentOSDType === OSD . Type . MediaVolume && currentMediaVolume < root . epsilon ) ;
154163 if (isMutedState)
155164 return Color .mError ;
156165
@@ -313,6 +322,15 @@ Variants {
313322 }
314323 }
315324
325+ // MediaService monitoring
326+ Connections {
327+ target: MediaService
328+
329+ function onVolumeChanged () {
330+ showOSD (OSD .Type .MediaVolume );
331+ }
332+ }
333+
316334 // Brightness monitoring
317335 Connections {
318336 target: BrightnessService
0 commit comments