diff options
author | awy <awy@awy.one> | 2025-08-18 01:03:27 +0300 |
---|---|---|
committer | awy <awy@awy.one> | 2025-08-18 01:03:27 +0300 |
commit | 2904911c1f629bfa0ec0397eb6dfd57400d16acf (patch) | |
tree | f1ac9cd41a5bb08e18641bc1ba373e58c2f71ae0 | |
parent | d13a243b280fc4ff0965e126f176bfd5622bc20c (diff) | |
download | hyprdots-2904911c1f629bfa0ec0397eb6dfd57400d16acf.tar.gz |
use portals instead of calculating stuff
-rwxr-xr-x | .local/bin/dmenurecord | 34 | ||||
-rwxr-xr-x | .local/bin/dmenuscreenshare | 2 |
2 files changed, 4 insertions, 32 deletions
diff --git a/.local/bin/dmenurecord b/.local/bin/dmenurecord index 6f51f5f..8c6938f 100755 --- a/.local/bin/dmenurecord +++ b/.local/bin/dmenurecord @@ -1,21 +1,5 @@ #!/bin/sh -# Usage: -# `$0`: Ask for recording type via mew -# `$0 screencast`: Record both audio and screen -# `$0 video`: Record only screen -# `$0 audio`: Record only audio -# `$0 kill`: Kill existing recording -# -# If there is already a running instance, user will be prompted to end it. - -getdim() { - screens=$(hyprctl monitors | grep Monitor | cut -d' ' -f2) - choice=$(printf "$screens\nExit\n" | mew) - [ "${choice}" != "Exit" ] || [ -z "${choice}" ] || exit && - echo $choice -} - updateicon() { \ echo "$1" > /tmp/recordingicon pkill -RTMIN+9 "${STATUSBAR:-waybar}" @@ -31,7 +15,7 @@ killrecording() { } screencast() { gpu-screen-recorder \ - -w "$(getdim)" \ + -w portal \ -f 60 \ -a default_output \ -a default_input \ @@ -41,7 +25,7 @@ screencast() { gpu-screen-recorder \ } video() { gpu-screen-recorder \ - -w "$(getdim)" \ + -w portal \ -f 60 \ -o "$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" & echo $! > /tmp/recordingpid @@ -77,12 +61,11 @@ audio() { \ } askrecording() { \ - choice=$(printf "screencast\\nvideo\\nvideo selected\\naudio\\nwebcam\\nwebcam (hi-def)" | mew -i -p "Select recording style:") + choice=$(printf "screencast\\nvideo\\naudio\\nwebcam\\nwebcam (hi-def)" | mew -i -p "Select recording style:") case "$choice" in screencast) screencast;; audio) audio;; video) video;; - *selected) videoselected;; webcam) webcam;; "webcam (hi-def)") webcamhidef;; esac @@ -93,21 +76,10 @@ asktoend() { \ [ "$response" = "Yes" ] && killrecording } -videoselected() -{ - gpu-screen-recorder \ - -w region -region $(slurp -f "%wx%h+%x+%y") \ - -f 60 \ - -o "$HOME/box-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! > /tmp/recordingpid - updateicon "⏺️" -} - case "$1" in screencast) screencast;; audio) audio;; video) video;; - *selected) videoselected;; kill) killrecording;; *) ([ -f /tmp/recordingpid ] && asktoend && exit) || askrecording;; esac diff --git a/.local/bin/dmenuscreenshare b/.local/bin/dmenuscreenshare index b4cd94e..169e416 100755 --- a/.local/bin/dmenuscreenshare +++ b/.local/bin/dmenuscreenshare @@ -2,7 +2,7 @@ get_window() { - input="$(echo $XDPH_WINDOW_SHARING_LIST | sed 's/\[HA>\]/\n/g' | sed -E 's/\[(HC|HE)>][^[]*//g')" + input="$(echo $XDPH_WINDOW_SHARING_LIST | sed 's/\[HE>\]/\n/g' | sed -E 's/\[(HC|HE)>][^[]*//g')" choice=$(echo "$input" | mew -l 10) printf '[SELECTION]/window:%s\n' "$choice" } |