aboutsummaryrefslogtreecommitdiff
path: root/hypr/wf-recorder/record.sh
blob: 1c174d56fa71a71f275675985790ebd5e1a4a3bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env bash

# Check if a recording is already in progress
if pgrep -x wf-recorder > /dev/null
then
    # If recording, stop it
    notify-send -h string:wf-recorder:record -t 1000 "Recording Stopped" && pkill wf-recorder
else
    # If not recording, start it
    mkdir -p ~/Videos
    mkdir -p ~/Videos/Screencasts/
    notify-send -h string:wf-recorder:record -t 1000 "Recording Started" && wf-recorder -f ~/Videos/Screencasts/$(date '+%H%M%S-%d-%m-%Y').mp4
fi