all repos — quickshell @ 55b30d92682fe15ee20bd17e46c79ca21e176659

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
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
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)
  text: '<span style="color:#c1a387;">│</span>' + Icons.volume.low + " " + vol + "%"
}

// 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
// bottomPadding: 0.5
// }