diff --git a/desktopenvs/hyprland/hypr-usr/binds.conf b/desktopenvs/hyprland/hypr-usr/binds.conf index a44391c..c3e6d55 100644 --- a/desktopenvs/hyprland/hypr-usr/binds.conf +++ b/desktopenvs/hyprland/hypr-usr/binds.conf @@ -52,7 +52,7 @@ $vimright = l $vimup = k $vimdown = j -bind = $mainMod CTRL, P, exec, bash ~/.config/scripts/togglewinbars.sh +bind = $mainMod CTRL, P, exec, ~/.config/scripts/screenrec.sh #bind = $mainMod, E, hyprexpo:expo, toggle # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more diff --git a/desktopenvs/hyprland/scripts/screenrec.sh b/desktopenvs/hyprland/scripts/screenrec.sh new file mode 100755 index 0000000..78d7263 --- /dev/null +++ b/desktopenvs/hyprland/scripts/screenrec.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +mkdir -p ~/Videos +statecon=$( pidof wf-recorder ) +if [ "$statecon" == '' ]; then + + rm ~/Videos/lastrec.mp4 + notify-send "recording started" + wf-recorder -g "$(slurp)" -a -f ~/Videos/lastrec.mp4 +else + + notify-send "recording ended" + killall -s SIGINT wf-recorder + wl-copy < ~/Videos/lastrec.mp4 +fi + +