Krolyxon
Commit 187d87f

Branches

Refs →

aurora187d87f

aurora: record desktop audio (default sink monitor)

Author
krolyxon
Date
2026-10-17 15:16 +0530
Parent
4cb24dd
Commit
187d87f8756d63617c79bff29c553087314090b1

+7 −3

1 file changed

  1. M .config/quickshell/aurora/Rec.qml +7 −3
M .config/quickshell/aurora/Rec.qml View
@@ -3,8 +3,10 @@ import QtQuick
33 import Quickshell
44 import Quickshell.Io
55 import Quickshell.Hyprland
6+import Quickshell.Services.Pipewire
67
7−// Screen recording with wf-recorder (region via slurp, or the focused monitor), saved to ~/vids/rec.
8+// Screen recording with wf-recorder (the focused monitor, or a region via slurp), saved to ~/vids/rec.
9+// Records desktop audio: the monitor source of the current default output (whatever you hear).
810 // Two steps so each can be cancelled: `selecting` (slurp is up) then `running` (wf-recorder records).
911 // stop() works in both. Everything is hidden if wf-recorder / slurp aren't installed.
1012 Singleton {
@@ -36,8 +38,10 @@ Singleton {
3638 var mon = Hyprland.focusedMonitor
3739 // exec so the Process pid is wf-recorder itself and SIGINT reaches it.
3840 // its (very chatty) output must go to a file: left on the Process pipe it dies without writing anything
39− var run = 'mkdir -p "${1%/*}" "${3%/*}"; exec wf-recorder ' + (geometry !== "" ? '-g' : '-o') + ' "$2" -f "$1" >"$3" 2>&1'
40− recProc.command = ["sh", "-c", run, "sh", file, geometry !== "" ? geometry : (mon ? mon.name : ""), log]
41+ var sink = Pipewire.defaultAudioSink
42+ var audio = sink ? "--audio=" + sink.name + ".monitor" : "--audio"
43+ var run = 'mkdir -p "${1%/*}" "${3%/*}"; exec wf-recorder ' + (geometry !== "" ? '-g' : '-o') + ' "$2" "$4" -f "$1" >"$3" 2>&1'
44+ recProc.command = ["sh", "-c", run, "sh", file, geometry !== "" ? geometry : (mon ? mon.name : ""), log, audio]
4145 elapsed = 0
4246 recProc.running = true
4347 }