Merge branch 'quattro' into unified-input-method-setup
This commit is contained in:
commit
101bb547bb
245 files changed
+19949
-375
No files matched your search
@@ -36,6 +36,11 @@
|
||||
"label": "Screen recording",
|
||||
"description": "GPU screen recorder status"
|
||||
},
|
||||
{
|
||||
"value": "RemoteSession",
|
||||
"label": "Remote session",
|
||||
"description": "Warning while someone is connected through gliff"
|
||||
},
|
||||
{
|
||||
"value": "Reminder",
|
||||
"label": "Reminder",
|
||||
|
||||
@@ -8,7 +8,7 @@ BarWidget {
|
||||
id: root
|
||||
moduleName: "omarchy.indicators"
|
||||
|
||||
readonly property var defaultIndicatorEntries: [ "PasswordlessSudo", "ScreenRecording", "Reminder", "NightLight", "Dnd", "StayAwake" ]
|
||||
readonly property var defaultIndicatorEntries: [ "PasswordlessSudo", "ScreenRecording", "RemoteSession", "Reminder", "NightLight", "Dnd", "StayAwake" ]
|
||||
readonly property var indicatorEntries: indicatorEntriesFromSettings(settings)
|
||||
property var activeIndicatorIds: []
|
||||
property var indicatorActiveStates: ({})
|
||||
|
||||
@@ -2,6 +2,7 @@ import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Services.Pipewire
|
||||
import qs.Ui
|
||||
import qs.Commons
|
||||
|
||||
BarWidget {
|
||||
id: root
|
||||
@@ -9,15 +10,28 @@ BarWidget {
|
||||
|
||||
|
||||
readonly property var source: Pipewire.defaultAudioSource
|
||||
readonly property bool muted: source && source.audio ? source.audio.muted : true
|
||||
readonly property real volume: source && source.audio ? source.audio.volume : 0
|
||||
// A virtual source is untyped in Quickshell, so it has no PwNode.audio; its
|
||||
// volume and mute go through wpctl (UntypedInput).
|
||||
readonly property bool viaWpctl: UntypedInput.active
|
||||
readonly property bool muted: viaWpctl ? (!UntypedInput.known || UntypedInput.muted) : (source && source.audio ? source.audio.muted : true)
|
||||
readonly property real volume: viaWpctl ? UntypedInput.volume : (source && source.audio ? source.audio.volume : 0)
|
||||
readonly property var nodes: Pipewire.nodes ? Pipewire.nodes.values : []
|
||||
readonly property var nodeNames: {
|
||||
var names = []
|
||||
for (var i = 0; i < nodes.length; i++)
|
||||
if (nodes[i] && nodes[i].name) names.push(String(nodes[i].name))
|
||||
return names
|
||||
}
|
||||
|
||||
readonly property var activeStreams: {
|
||||
var list = []
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var node = nodes[i]
|
||||
if (node && node.isStream && node.isSink === false && !node.audio?.muted) list.push(node)
|
||||
if (!node || !node.isStream || node.isSink !== false || node.audio?.muted) continue
|
||||
// The shell's own level meters, and a platform's audio processing that
|
||||
// records all the time, are not an app using the microphone.
|
||||
if (AudioNodes.isShellLevelMeter(node.name) || AudioNodes.platformHides(node.name, nodeNames)) continue
|
||||
list.push(node)
|
||||
}
|
||||
return list
|
||||
}
|
||||
@@ -29,7 +43,10 @@ BarWidget {
|
||||
implicitHeight: button.implicitHeight
|
||||
|
||||
function toggleMute() {
|
||||
if (source && source.audio) source.audio.muted = !source.audio.muted
|
||||
if (viaWpctl) {
|
||||
if (UntypedInput.known) UntypedInput.setMuted(!UntypedInput.muted)
|
||||
}
|
||||
else if (source && source.audio) source.audio.muted = !source.audio.muted
|
||||
}
|
||||
|
||||
PwObjectTracker { objects: root.source ? [root.source] : [] }
|
||||
@@ -46,8 +63,12 @@ BarWidget {
|
||||
else root.toggleMute()
|
||||
}
|
||||
onWheelMoved: function(delta) {
|
||||
if (!root.source || !root.source.audio) return
|
||||
var step = 0.05
|
||||
if (root.viaWpctl) {
|
||||
if (UntypedInput.known) UntypedInput.setVolume(root.volume + (delta > 0 ? step : -step))
|
||||
return
|
||||
}
|
||||
if (!root.source || !root.source.audio) return
|
||||
root.source.audio.volume = Math.max(0, Math.min(1, root.volume + (delta > 0 ? step : -step)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user