Skip to content
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
66e0d94
C++ script to record with wf-recorder
0xAquora Apr 12, 2025
d035272
Update keybindings.conf
0xAquora Apr 12, 2025
06fd56e
Update pkg_core.lst
0xAquora Apr 12, 2025
38c90ba
Delete Configs/.local/lib/hyde/smart-recorder
0xAquora Apr 12, 2025
b0cbbc0
Uploaded script to use wf-recorder easily.
0xAquora Apr 12, 2025
a3919f5
Added files to record screen through keybind.
0xAquora Apr 12, 2025
0c89738
Update keybindings.conf
0xAquora Apr 12, 2025
cb8caa1
Update keybindings.conf
0xAquora Apr 12, 2025
cd21ef3
Update keybindings.conf
0xAquora Apr 12, 2025
e752218
Update keybindings.conf
0xAquora Apr 12, 2025
bc9ed3b
Delete Configs/.local/lib/hyde/smart-recorder
0xAquora Apr 12, 2025
d9f0da5
Added wf-recorder.sh
0xAquora Apr 13, 2025
5a12fac
Delete Configs/.local/lib/hyde/get_encoder.sh
0xAquora Apr 13, 2025
919a402
Delete Configs/.local/lib/hyde/record_video_audio.sh
0xAquora Apr 13, 2025
585463f
Delete Configs/.local/lib/hyde/record_video.sh
0xAquora Apr 13, 2025
5dc3ad8
Update keybindings.conf
0xAquora Apr 13, 2025
31b4fa0
Merge branch 'master' into master
0xAquora Apr 17, 2025
5294cd6
Update keybindings.conf
0xAquora Apr 21, 2025
afbcd74
Update pkg_core.lst
0xAquora Apr 21, 2025
1da0659
Update pkg_extra.lst
0xAquora Apr 21, 2025
53010ec
Merge branch 'master' into master
0xAquora Apr 21, 2025
31256ab
rename to generic "screenrecord"
kRHYME7 Apr 21, 2025
57d48c8
Added wk-screenrec and wf-recorder backend support . sheshhhhh
kRHYME7 Apr 21, 2025
145a24c
use --start
kRHYME7 Apr 21, 2025
ea71cec
Merge branch 'master' into master
kRHYME7 Apr 22, 2025
02a2a98
Update pkg_extra.lst
kRHYME7 Apr 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 151 additions & 0 deletions Configs/.local/lib/hyde/screenrecord.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
#!/usr/bin/env bash

set -euo pipefail

# shellcheck source=$HOME/.local/bin/hyde-shell
# shellcheck disable=SC1091
if ! source "$(command -v hyde-shell)"; then
echo "[wf-recorder] code :: Error: hyde-shell not found."
echo "[wf-recorder] code :: Is HyDE installed?"
exit 1
fi

RECORDER="wl-screenrec"
command -v "$RECORDER" &>/dev/null || RECORDER="wf-recorder"
if ! command -v "$RECORDER" &>/dev/null; then
notify-send -a "HyDE Alert" "No screen recorder found. Try installing wl-screenrec or wf-recorder."
echo "No screen recorder found. Try installing wl-screenrec or wf-recorder."
exit 1
fi

USAGE() {
cat <<USAGE

Usage: 'hyde-shell screenrecord' [option]

Using ${RECORDER} to record the screen.

Options:

--start Screen record
--backend Use 'wl-screenrec' or 'wf-recorder' as the backend
--file Specify the output file
--quit Stop the recording
--help Show this help message
-- Pass additional arguments to '${RECORDER}'

Note:

Click and drag on the screen to select a region to record.
To record the whole screen, simply click without dragging.

Additional arguments are passed to '${RECORDER}'.

Example:
'hyde-shell screenrecord' --record -- --audio --codec libx264


To see all available options for '${RECORDER}', run:
${RECORDER} --help

USAGE
}

handle_recording() {

save_dir="${XDG_VIDEOS_DIR:-$HOME/Videos}/Recordings"
save_file=$(date +'%y%m%d_%Hh%Mm%Ss_recording.mp4')
save_file_path="${FILE_PATH:-"${save_dir}/${save_file}"}"
mkdir -p "$save_dir"

parameters=()

# Process additional arguments after --
while [[ $# -gt 0 ]]; do
if [[ "$1" == "--" ]]; then
shift
# Add all remaining arguments to parameters array
while [[ $# -gt 0 ]]; do
parameters+=("$1")
shift
done
break
fi
shift
done

OUTPUT="$(hyprctl -j monitors | jq -r '.[] | select(.focused==true) | .name')"
GEOM="$(
# Only accept selections at least 16x16 pixels in size
slurp -w 0 -b "#00000000" -c "#FFFFFF" -s "#00000055" -B "#00000000" -o | awk '{
# slurp outputs format: x,y WxH
split($1, pos, ","); # Split x,y
x = pos[1];
y = pos[2];
split($2, size, "x"); # Split WxH
width = size[1];
height = size[2];

# Check if selection meets minimum size
if (width >= 16 && height >= 16) {
print x","y" "width"x"height; # Output in the same format
}
}'

)"

if [[ -n "$GEOM" ]]; then
parameters+=("--geometry" "$GEOM")
else
echo "Using whole screen for recording"
[[ -n "$OUTPUT" ]] && parameters+=(--output "$OUTPUT")
fi

tmp_thumbnail=$(mktemp -t thumbnail_XXXXXX.png)
if [[ -z "$GEOM" ]]; then
"$LIB_DIR/hyde/grimblast" save active "$tmp_thumbnail"
else
grim -g "$GEOM" "$tmp_thumbnail"
fi

"${RECORDER}" "${parameters[@]}" -f "${save_file_path}"
notify-send -a "HyDE Alert" "${RECORDER}: Recording saved at ${save_file_path}" -i "${tmp_thumbnail}"
}

# Process arguments with while loop
while [[ $# -gt 0 ]]; do
case "$1" in
--file)
shift
FILE_PATH="$1"
;;
--backend)
shift
RECORDER="$1"
;;
--start)
handle_recording "$@"
exit 0
;;
--quit)
killall "${RECORDER}"
notify-send -a "HyDE Alert" "Recording stopped"
exit 0
;;
--help)
USAGE
exit 0
;;
*)
# Unknown option
USAGE
exit 1
;;
esac
shift
done

# If no arguments provided, show usage
if [[ $# -eq 0 ]]; then
USAGE
fi
1 change: 1 addition & 0 deletions Scripts/pkg_extra.lst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ddcui # GUI to control brightne
# --------------------------------------------------- // Misc
xdg-desktop-portal-gtk # xdg desktop portal using gtk
# emote # emoji picker gtk3
# wf-recorder # screen recording tool

# --------------------------------------------------- // Gaming
steam # gaming platform
Expand Down