aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/swayrecord
blob: 378b46f59f2940a9f389044634cb83e8451131f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

if [ -f "$HOME/.cache/recordingpid" ]; then
    killall -SIGINT wf-recorder
    rm -f ~/.cache/recordingpid
    notify-send "⏺ Screen recording" "Recording stopped"
    killall -39 waybar
    exit
fi

wf-recorder -f "$HOME/Videos/recordings/$(date '+%y%m%d-%H%M-%S').mp4" &
echo $! > ~/.cache/recordingpid
notify-send "⏺ Screen recording" "Recording started"
killall -39 waybar