Created
October 4, 2025 21:53
-
-
Save Loupax/9b1b79dba028a935c1669d4e4f10dd29 to your computer and use it in GitHub Desktop.
Recording setup for sway and waybar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"custom/recorder": { | |
"return-type": "json", | |
"format": "{}", | |
"interval": 1, | |
"exec": "~/.config/sway/scripts/waybar-recorder-status.sh", | |
"on-click": "killall -s SIGINT wf-recorder && notify-send 'Recording stopped and saved'" | |
}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
output_dir="$HOME/Videos/Screencaps" | |
mkdir -p "$output_dir" | |
chosen_option=$(tofi <<EOF | |
Record Region (MP4) | |
Record Fullscreen (MP4) | |
EOF | |
) | |
case "$chosen_option" in | |
"Record Region (MP4)") | |
geometry=$(slurp) | |
if [ -z "$geometry" ]; then | |
exit 0 | |
fi | |
wf-recorder -g "$geometry" -a -f "$output_dir/$(date +'%Y-%m-%d_%H-%M-%S').mp4" & | |
;; | |
"Record Fullscreen (MP4)") | |
wf-recorder -a -f "$output_dir/$(date +'%Y-%m-%d_%H-%M-%S')-fullscreen.mp4" & | |
;; | |
esac | |
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if the wf-recorder process is running | |
if pgrep -x "wf-recorder" > /dev/null; then | |
echo '{"text": "🔴 STOP", "tooltip": "A recording is in progress.\nClick to stop.", "class": "recording"}' | |
else | |
# If wf-recorder is not running, output empty text to hide the module | |
echo '{"text": ""}' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment