2022-08-01 19:02:25 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
Color_Off='\033[0m' # Text Reset
|
|
|
|
|
|
|
|
# Regular Colors
|
|
|
|
Black='\033[0;30m' # Black
|
|
|
|
Red='\033[0;31m' # Red
|
|
|
|
Green='\033[0;32m' # Green
|
|
|
|
Yellow='\033[0;33m' # Yellow
|
|
|
|
Blue='\033[0;34m' # Blue
|
|
|
|
Purple='\033[0;35m' # Purple
|
|
|
|
Cyan='\033[0;36m' # Cyan
|
|
|
|
White='\033[0;37m' # White
|
|
|
|
|
|
|
|
msg() {
|
2022-10-09 17:54:37 +02:00
|
|
|
echo -e ":: ${*}$Color_Off"
|
2022-08-01 19:02:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
msg2() {
|
2022-10-09 17:54:37 +02:00
|
|
|
echo -e "$Red!!$Color_Off ${*}$Color_Off"
|
2022-08-01 19:02:25 +02:00
|
|
|
}
|
|
|
|
|
2022-10-09 17:54:37 +02:00
|
|
|
DECK_UIOVERRIDES="/home/deck/.steam/root/config/uioverrides"
|
|
|
|
DECK_UIOVERRIDES_MOVIES="${DECK_UIOVERRIDES}/movies"
|
|
|
|
DECK_UIOVERRIDES_STARTUP="${DECK_UIOVERRIDES_MOVIES}/deck_startup.webm"
|
2022-08-01 19:02:25 +02:00
|
|
|
|
2022-10-09 17:54:37 +02:00
|
|
|
restore_backup() {
|
|
|
|
DECK_STARTUP_FILE="/home/deck/.steam/steam/steamui/movies/deck_startup.webm"
|
|
|
|
DECK_STARTUP_STOCK_MD5="4ee82f478313cf74010fc22501b40729"
|
|
|
|
|
|
|
|
if [[ -f "$DECK_STARTUP_FILE.backup" ]]; then
|
2022-08-01 19:02:25 +02:00
|
|
|
checksum="$(md5sum "$DECK_STARTUP_FILE" | cut -d ' ' -f 1)"
|
|
|
|
if [[ "$checksum" != "$DECK_STARTUP_STOCK_MD5" ]]; then
|
2022-10-09 17:54:37 +02:00
|
|
|
rm "$DECK_STARTUP_FILE"
|
|
|
|
mv "$DECK_STARTUP_FILE.backup" "$DECK_STARTUP_FILE"
|
2022-08-01 19:02:25 +02:00
|
|
|
fi
|
2022-10-09 17:54:37 +02:00
|
|
|
|
|
|
|
rm "$DECK_STARTUP_FILE.backup"
|
2022-08-01 19:02:25 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
list_animations() {
|
2022-10-09 17:54:37 +02:00
|
|
|
find deck_startup/ -type f -iname '*.webm' -print0
|
2022-08-01 19:02:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
random_animation() {
|
|
|
|
mapfile -d $'\0' animations < <(list_animations)
|
|
|
|
echo "${animations[$RANDOM % ${#animations[@]}]}"
|
|
|
|
}
|
|
|
|
|
2022-10-09 17:54:37 +02:00
|
|
|
restore_backup
|
2022-09-20 03:27:45 +02:00
|
|
|
|
2022-08-01 19:02:25 +02:00
|
|
|
animation="$(random_animation)"
|
|
|
|
msg "Using $animation"
|
2022-10-09 17:54:37 +02:00
|
|
|
mkdir -p "${DECK_UIOVERRIDES_MOVIES}"
|
|
|
|
ln -f "$animation" "$DECK_UIOVERRIDES_STARTUP"
|
2022-08-01 19:02:25 +02:00
|
|
|
|