add polymouth animation

This commit is contained in:
DACHXY 2024-12-19 19:14:59 +08:00
parent 07d70e3a64
commit fca902de1a
18 changed files with 124 additions and 294 deletions

View file

@ -1,11 +1,10 @@
#!/usr/bin/bash
#!/usr/bin/env bash
#Script to run SCRCPY
if pgrep -x "scrcpy" > /dev/null
then
pkill -x scrcpy
exit
if pgrep -x "scrcpy" >/dev/null; then
pkill -x scrcpy
exit
fi
# Get connected devices
@ -14,21 +13,21 @@ device_count=$(echo "$devices" | wc -l)
# If no devices are found, exit the script
if [ "$device_count" -eq 0 ]; then
notify-send "No devices connected."
exit 1
notify-send "No devices connected."
exit 1
fi
# If multiple devices are connected, prompt to select one
if [ "$device_count" -gt 1 ]; then
selected_device=$(echo "$devices" | rofi -dmenu -config ~/.config/dotfiles/rofi/config.rasi -p "Select Device: ")
selected_device=$(echo "$devices" | rofi -dmenu -config ~/.config/dotfiles/rofi/config.rasi -p "Select Device: ")
else
selected_device=$(echo "$devices")
selected_device=$(echo "$devices")
fi
# If no device was selected, exit the script
if [ -z "$selected_device" ]; then
echo "No device selected."
exit 1
echo "No device selected."
exit 1
fi
# Options for SCRCPY modes
@ -39,16 +38,16 @@ selected_option=$(echo -e "$options" | rofi -dmenu -config ~/.config/dotfiles/ro
# Run scrcpy with the selected mode and device
case "$selected_option" in
"Video")
scrcpy --serial "$selected_device" --max-size=1024 --video-codec=h265 --video-bit-rate=6M --audio-bit-rate=128K --max-fps=30 --no-audio
;;
"No Video")
scrcpy --serial "$selected_device" --no-window
;;
"Video & Audio")
scrcpy --serial "$selected_device" --max-size=1024 --video-codec=h265 --video-bit-rate=6M --audio-bit-rate=128K --max-fps=30
;;
*)
echo "Invalid selection"
;;
"Video")
scrcpy --serial "$selected_device" --max-size=1024 --video-codec=h265 --video-bit-rate=6M --audio-bit-rate=128K --max-fps=30 --no-audio
;;
"No Video")
scrcpy --serial "$selected_device" --no-window
;;
"Video & Audio")
scrcpy --serial "$selected_device" --max-size=1024 --video-codec=h265 --video-bit-rate=6M --audio-bit-rate=128K --max-fps=30
;;
*)
echo "Invalid selection"
;;
esac