summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornavewindre <boneyaard@gmail.com>2025-03-27 03:06:27 +0100
committernavewindre <boneyaard@gmail.com>2025-03-27 03:06:27 +0100
commit68ffa486d376c57cfc0212825f1139d19f15e562 (patch)
tree905ad6f6d4287210c6da961facd69bfe2305b39b
parentbe84cfa2cf65f7da9e9049f3a64c70d7bafb146e (diff)
ye
-rw-r--r--config/openbox/rc-templ.xml5
-rwxr-xr-xrecord.sh25
2 files changed, 30 insertions, 0 deletions
diff --git a/config/openbox/rc-templ.xml b/config/openbox/rc-templ.xml
index c1da4f1..5db0c0a 100644
--- a/config/openbox/rc-templ.xml
+++ b/config/openbox/rc-templ.xml
@@ -330,6 +330,11 @@
<command>scrot -s -e 'xclip -selection clipboard -t image/png -i $f &amp;&amp; rm $f'</command>
</action>
</keybind>
+ <keybind key="W-F11">
+ <action name="Execute">
+ <command>desktop-audio-record</command>
+ </action>
+ </keybind>
<keybind key="W-C-e">
<action name="Execute">
<command>ocr</command>
diff --git a/record.sh b/record.sh
new file mode 100755
index 0000000..e5e05e9
--- /dev/null
+++ b/record.sh
@@ -0,0 +1,25 @@
+#!/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=$!
+while true; do
+ read -t 0.1 -n 1 key
+ if [[ $key == $'\e' ]]; then
+ cleanup
+ fi
+done
+
+wait $FFMPEG_PID