dots

my dotfiles
git clone https://git.awy.one/dots
Log | Files | Refs | Submodules | README | LICENSE

commit ec5c22e3d49f8edbeb1682d0f9565cbe3487004b
parent 85b5fa8d5b9c72af19f5ce946630b7b2c170b1b6
Author: awy <awy@awy.one>
Date:   Sun, 21 Dec 2025 04:30:53 +0300

update

Diffstat:
M.local/bin/dmenurecord | 83+++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------
1 file changed, 54 insertions(+), 29 deletions(-)

diff --git a/.local/bin/dmenurecord b/.local/bin/dmenurecord @@ -10,21 +10,13 @@ # If there is already a running instance, user will be prompted to end it. getdim() { - screens=$(swaymsg -t get_outputs --raw | jq -r '.[].name') - choice=$(printf "%s\nExit\n" "$screens" | mew) - [ "${choice}" != "Exit" ] || [ -z "${choice}" ] || exit && - echo "$choice" + gpu-screen-recorder --list-capture-options | sed 's/|[0-9]\{1,\}x[0-9]\{1,\}//g' | + mew -c -l 10 -p "Select output: " } updateicon() { - if [ -z "$1" ]; then - rm -f /tmp/recordingicon - pkill -RTMIN+9 "${STATUSBAR:-i3blocks}" - exit - fi - printf "<span color='#FB4934'>rec:</span>" >/tmp/recordingicon - echo "$1" >>/tmp/recordingicon - pkill -RTMIN+9 "${STATUSBAR:-i3blocks}" + echo "$1" >/tmp/recordingicon + pkill -RTMIN+9 ".*blocks|waybar" } killrecording() { @@ -33,27 +25,29 @@ killrecording() { kill -2 "$recpid" rm -f /tmp/recordingpid updateicon "" - pkill -RTMIN+9 "${STATUSBAR:-i3blocks}" + pkill -RTMIN+9 ".*blocks|waybar" } screencast() { gpu-screen-recorder \ -w "$(getdim)" \ + -fm content \ -f 60 \ -a default_output \ -a default_input \ -o "$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mkv" & echo $! >/tmp/recordingpid - updateicon "audio+mic" + updateicon "📹🎙️" } video() { gpu-screen-recorder \ -w "$(getdim)" \ + -fm content \ -f 60 \ -o "$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" & echo $! >/tmp/recordingpid - updateicon "video only" + updateicon "📹" } webcamhidef() { @@ -63,7 +57,7 @@ webcamhidef() { -video_size 1920x1080 \ "$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" & echo $! >/tmp/recordingpid - updateicon "webcam(hq)" + updateicon "📷(hq)" } webcam() { @@ -73,7 +67,7 @@ webcam() { -video_size 640x480 \ "$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" & echo $! >/tmp/recordingpid - updateicon "webcam" + updateicon "📷" } audio() { @@ -82,13 +76,47 @@ audio() { -c:a flac \ "$HOME/audio-$(date '+%y%m%d-%H%M-%S').flac" & echo $! >/tmp/recordingpid - updateicon "audio only" + updateicon "🎙️" +} + +replay() { + gpu-screen-recorder \ + -w "$(getdim)" \ + -fm content \ + -f 60 \ + -r 60 \ + -c mkv \ + -a default_output \ + -a default_input \ + -o "/mnt/ssd/rndm/clips/replays" & + echo $! >/tmp/recordingpid + updateicon "🔃📹🎙️" +} + +savereplay() { + recpid="$(bat /tmp/recordingpid)" + echo $recpid + kill -37 "$recpid" + pkill -RTMIN+9 ".*blocks|waybar" + notify-send "Replay" "Last 60 seconds saved" + exit +} + +videoselected() { + gpu-screen-recorder \ + -w region -region "$(slurp -f "%wx%h+%x+%y")" \ + -fm content \ + -f 60 \ + -o "$HOME/box-$(date '+%y%m%d-%H%M-%S').mkv" & + echo $! >/tmp/recordingpid + updateicon "📹(selected)" } askrecording() { - choice=$(printf "screencast\\nvideo\\nvideo selected\\naudio\\nwebcam\\nwebcam (hi-def)" | mew -i -p "Select recording style:") + choice=$(printf "screencast\\nreplay\\nvideo\\naudio\\nwebcam\\nwebcam (hi-def)" | mew -c -l 7 -i -p "Select recording style:") case "$choice" in screencast) screencast ;; + replay) replay ;; audio) audio ;; video) video ;; *selected) videoselected ;; @@ -98,21 +126,18 @@ askrecording() { } asktoend() { - response=$(printf "No\\nYes" | mew -i -p "Recording still active. End recording?") && - [ "$response" = "Yes" ] && killrecording -} + if grep -q "🔃" /tmp/recordingicon; then + response=$(printf "No\\nYes" | mew -c -l 2 -i -p "Replay is active. Save it?") && + [ "$response" = "Yes" ] && savereplay + fi -videoselected() { - gpu-screen-recorder \ - -w region -region "$(slurp -f "%wx%h+%x+%y")" \ - -f 60 \ - -o "$HOME/box-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! >/tmp/recordingpid - updateicon "video selected" + response=$(printf "No\\nYes" | mew -c -l 2 -i -p "Recording still active. End recording?") && + [ "$response" = "Yes" ] && killrecording } case "$1" in screencast) screencast ;; +replay) replay ;; audio) audio ;; video) video ;; *selected) videoselected ;;