summaryrefslogtreecommitdiff
path: root/desktop-audio-record
diff options
context:
space:
mode:
authornavewindre <boneyaard@gmail.com>2025-06-19 12:12:50 +0200
committernavewindre <boneyaard@gmail.com>2025-06-19 12:12:50 +0200
commitad0dc8421236b6a706efd6512d63a834c7463394 (patch)
tree13102630042e10c3399255fc81564d17a107ea80 /desktop-audio-record
parente6d4cd1315c7cfdef37c8c676b768c4f6ba7ea45 (diff)
a
Diffstat (limited to 'desktop-audio-record')
-rwxr-xr-xdesktop-audio-record20
1 files changed, 20 insertions, 0 deletions
diff --git a/desktop-audio-record b/desktop-audio-record
new file mode 100755
index 0000000..2e8bc74
--- /dev/null
+++ b/desktop-audio-record
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+rm /tmp/desktop_audio_temp.mp3
+
+cleanup() {
+ echo "Recording stopped. Cleaning up..."
+ kill $FFMPEG_PID
+ echo "file:///tmp/desktop_audio_temp.mp3" | xclip -sel c
+ gxmessage -geometry 350x50 -title "audio recorded" -center "desktop dudio has been copied to your clipboard."
+ exit 0
+}
+
+trap cleanup SIGINT SIGTERM
+
+ffmpeg -f pulse -i alsa_output.usb-FX-AUDIO-_DAC-X3PRO_20313330544D4319001C8004-00.analog-stereo.monitor /tmp/desktop_audio_temp.mp3 &
+
+FFMPEG_PID=$!
+xev | grep -q "keycode: 9" && cleanup
+
+wait $FFMPEG_PID