all repos — quickshell @ 30865761e689b0a29ec234f784984f91de45e8c6

A desert-witch desktop shell

bar/modules/Volume.qml (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
import QtQuick
import Quickshell.Services.Pipewire
import "classes"
import "../.."

BarText {
  id: volume_indicator
  PwObjectTracker {
    objects: [Pipewire.defaultAudioSink]
  }
  property var muted: Pipewire.defaultAudioSink?.audio.muted
  property var vol: Math.round((Pipewire.defaultAudioSink?.audio.volume ?? 0) * 100)
  property var indicator: (muted) ? 0 : vol < 20 ? 1 : vol <= 50 ? 2 : 3
  text: Resources.sep + Icons.volume[indicator] + vol + "%"
  color: (muted) ? Style.altbg : Style.fg
}