apt install dmenu i3 ffmpeg i3blocks touch ~/scripts/dmenurecord nano dmenurecord ------------------------------------------------------ #!/bin/sh # Usage: # `record`: Ask for recording type via dmenu # `record screencast`: Record both audio and screen # `record video`: Record only screen # `record audio`: Record only audio # `record kill`: Kill existing recording # # If there is already a running instance, user will be prompted to end it. updateicon() { \ echo "$1" > /tmp/recordingicon pkill -RTMIN+9 i3blocks } killrecording() { recpid="$(cat /tmp/recordingpid)" # kill with SIGTERM, allowing finishing touches. kill -15 "$recpid" rm -f /tmp/recordingpid updateicon "" pkill -RTMIN+9 i3blocks # even after SIGTERM, ffmpeg may still run, so SIGKILL it. sleep 3 kill -9 "$recpid" exit } screencast() { \ ffmpeg -y \ -f x11grab \ -framera