move qs config to work on mango and do general improvements
This commit is contained in:
commit
0f8929c55a
30 changed files with 994 additions and 0 deletions
65
modules/bar/Pw.qml
Normal file
65
modules/bar/Pw.qml
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
import Quickshell.Services.Pipewire
|
||||
import Quickshell.Io
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Effects
|
||||
import qs
|
||||
import qs.widgets
|
||||
import qs.settings
|
||||
|
||||
BarComponent {
|
||||
id: root
|
||||
color: clickHandler.containsMouse ? Colors.activeModuleBg : Colors.moduleBg
|
||||
property PwNode defaultAudio: Pipewire.ready ? Pipewire.defaultAudioSink : null
|
||||
property bool mute: Pipewire.ready ? defaultAudio?.audio.muted : null
|
||||
implicitHeight: Config.moduleHeight
|
||||
implicitWidth: pwLayout.implicitWidth + 16
|
||||
function getVolumeIcon() {
|
||||
let volume = Pipewire.ready ? root.defaultAudio.audio.volume : null;
|
||||
if (root.mute) {
|
||||
return "\ue04f";
|
||||
}
|
||||
if (volume <= 0.33) {
|
||||
return "\ue04e";
|
||||
}
|
||||
if (volume <= 0.66) {
|
||||
return "\ue04d";
|
||||
}
|
||||
if (volume >= 0.66) {
|
||||
return "\ue050";
|
||||
}
|
||||
}
|
||||
|
||||
PwObjectTracker {
|
||||
objects: [Pipewire.ready ? Pipewire.defaultAudioSink : null]
|
||||
}
|
||||
|
||||
Process {
|
||||
id: pavuLauncher
|
||||
command: ["pavucontrol"]
|
||||
running: false
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: pwLayout
|
||||
anchors.centerIn: root
|
||||
spacing: 4
|
||||
MaterialIcon {
|
||||
text: root.getVolumeIcon()
|
||||
opacity: root.defaultAudio?.audio.muted ? 0.6 : 1.0
|
||||
}
|
||||
StyledText {
|
||||
text: Math.round(root.defaultAudio?.audio.volume * 100) + "%"
|
||||
opacity: root.defaultAudio?.audio.muted ? 0.6 : 1.0
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
id: clickHandler
|
||||
hoverEnabled: true
|
||||
acceptedButtons: Qt.LeftButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
anchors.fill: root
|
||||
onClicked: pavuLauncher.running = true
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue