aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.local/bin/dmenurecord34
-rwxr-xr-x.local/bin/dmenuscreenshare2
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"
}