This commit is contained in:
2025-08-15 12:59:28 +02:00
parent 2a3f8f7294
commit 6a3de0df23
13 changed files with 367 additions and 38 deletions

View File

@@ -6,4 +6,4 @@ exec-once = uwsm app -- nm-applet
exec-once = uwsm app -- nextcloud --background
exec-once = uwsm app -- rclone mount google_drive: ~/gdrive
exec-once = uwsm app -- protonvpn-app
exec-once = uwsm app -- sh -c "/usr/bin/discord discord --enable-features=UseOzonePlatform --ozone-platform=wayland --start-minimized &> /dev/null"
# exec-once = uwsm app -- sh -c "/usr/bin/discord --enable-features=UseOzonePlatform --ozone-platform=wayland --start-minimized &> /dev/null"

68
hypr/scripts/droidcam-ctrl.sh Executable file
View File

@@ -0,0 +1,68 @@
#!/bin/sh
PROGRAM_NAME="droidcam-cli"
PID_FILE="/tmp/droidcam.pid"
ANDROID_SERIAL=988e5035584a354b4430
start() {
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if ps -p "$PID" > /dev/null; then
notify-send -u low "$PROGRAM_NAME" "$PROGRAM_NAME is already active."
exit 0
fi
fi
notify-send -u low "$PROGRAM_NAME" "$PROGRAM_NAME is starting ..."
ANDROID_SERIAL=$ANDROID_SERIAL droidcam-cli -a -v -size=1920x1080 adb 4747 &> /dev/null &
echo $! > "$PID_FILE"
}
stop() {
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if ps -p "$PID" > /dev/null; then
kill "$PID"
rm "$PID_FILE"
notify-send -u low "$PROGRAM_NAME" "$PROGRAM_NAME has been stopped."
else
rm "$PID_FILE" # Stale PID file
notify-send -u low "$PROGRAM_NAME" "$PROGRAM_NAME is not running."
fi
else
notify-send -u low "$PROGRAM_NAME" "$PROGRAM_NAME is not running."
fi
}
toggle() {
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if ps -p "$PID" > /dev/null; then
stop
else
rm "$PID_FILE" # Stale PID file
start
fi
else
start
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
toggle)
toggle
;;
*)
echo "Usage: $0 {start|stop|save}"
exit 1
esac
exit 0

104
hypr/scripts/replay-ctrl.sh Executable file
View File

@@ -0,0 +1,104 @@
#!/bin/sh
PROGRAM_NAME="gpu-screen-recorder"
PID_FILE="/tmp/gpu-screen-recorder.pid"
start() {
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if ps -p "$PID" > /dev/null; then
notify-send -u low "$PROGRAM_NAME" "$PROGRAM_NAME is already active."
exit 0
fi
fi
video_path="$HOME/Videos/replay/"
mkdir -p "$video_path"
notify-send -u low "$PROGRAM_NAME" "$PROGRAM_NAME is starting ..."
gpu-screen-recorder \
-w screen \
-f 60 \
-a default_output -a default_input \
-fm vfr \
-c mkv \
-encoder gpu \
-bm qp \
-cr full \
-tune quality \
-k av1_10bit \
-q high \
-r 120 \
-replay-storage ram \
-ab 320 \
-cursor yes \
-sc "$HOME/.config/hypr/scripts/replay-notification.sh" \
-o "$video_path" &> /dev/null &
echo $! > "$PID_FILE"
}
stop() {
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if ps -p "$PID" > /dev/null; then
kill "$PID"
rm "$PID_FILE"
notify-send -u low "$PROGRAM_NAME" "$PROGRAM_NAME has been stopped."
else
rm "$PID_FILE" # Stale PID file
notify-send -u low "$PROGRAM_NAME" "$PROGRAM_NAME is not running."
fi
else
notify-send -u low "$PROGRAM_NAME" "$PROGRAM_NAME is not running."
fi
}
toggle() {
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if ps -p "$PID" > /dev/null; then
stop
else
rm "$PID_FILE" # Stale PID file
start
fi
else
start
fi
}
save() {
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if ps -p "$PID" > /dev/null; then
pkill -SIGUSR1 -f gpu-screen-recorder
else
# The process is not running, but the PID file exists.
# This can happen if the process crashed.
# We'll remove the stale PID file.
rm "$PID_FILE"
notify-send -u low "$PROGRAM_NAME" "$PROGRAM_NAME is not running."
fi
else
notify-send -u low "$PROGRAM_NAME" "$PROGRAM_NAME is not running."
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
save)
save
;;
toggle)
toggle
;;
*)
echo "Usage: $0 {start|stop|save}"
exit 1
esac
exit 0

View File

@@ -0,0 +1,17 @@
#!/bin/sh
PROGRAM_NAME="gpu-screen-recorder"
case "$2" in
replay)
notify-send -u low "$PROGRAM_NAME" "Replay saved: $1"
;;
regular)
notify-send -u low "$PROGRAM_NAME" "Stream/Video saved: $1"
;;
*)
echo "Usage: $0 {saved_file} {replay|regular}"
exit 1
esac
exit 0

View File

@@ -0,0 +1,7 @@
#!/bin/sh
sleep 1
killall -e xdg-desktop-portal-hyprland
killall xdg-desktop-portal
/usr/lib/xdg-desktop-portal-hyprland &
sleep 2
/usr/lib/xdg-desktop-portal &

4
hypr/scripts/start_droidcam.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
scrcpy -d
ANDROID_SERIAL=988e5035584a354b4430 droidcam-cli -a -v -size=1920x1080 adb 4747