From d5a9378cea4c380d9983a24152cf8b21a182dfad Mon Sep 17 00:00:00 2001 From: Muddyblack Date: Fri, 12 Jan 2024 20:53:17 +0100 Subject: [PATCH 1/5] use unused tty's instead fixed --- images_slide_show.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/images_slide_show.sh b/images_slide_show.sh index 79aa614..f30f84b 100755 --- a/images_slide_show.sh +++ b/images_slide_show.sh @@ -60,15 +60,31 @@ display() { kill_display_processes + # Find an unused TTY + unused_tty="" + for tty in {1..7}; do + if ! who | grep -q "tty$tty"; then + unused_tty=$tty + break + fi + done + + if [ -z "$unused_tty" ]; then + echo "No unused TTY found!" + return 1 + fi + if [[ ${#image_files[@]} -gt 0 && ${#video_files[@]} -gt 0 ]]; then while true; do - sudo fbi -a -r 3 -t $DISPLAYTIME --blend $BLENDTIME -T 1 --noverbose -1 "${image_files[@]}" + sudo chvt $unused_tty + sudo fbi -a -r 3 -t $DISPLAYTIME --blend $BLENDTIME -T $unused_tty --noverbose -1 "${image_files[@]}" sleep $((IMAGE_FILES_COUNT * DISPLAYTIME)) sudo pkill -x "fbi" cvlc "$video_files" done elif [ -n "$image_files" ]; then - sudo fbi -a -r 5 -t $DISPLAYTIME --blend $BLENDTIME -T 1 --noverbose "${image_files[@]}" + sudo chvt $unused_tty + sudo fbi -a -r 5 -t $DISPLAYTIME --blend $BLENDTIME -T $unused_tty --noverbose "${image_files[@]}" elif [ -n "$video_files" ]; then #clear cvlc --loop "$video_files" From 94056eef4d7df261bbf9ee300aa3b1ead650a9f6 Mon Sep 17 00:00:00 2001 From: Muddyblack Date: Fri, 12 Jan 2024 21:19:31 +0100 Subject: [PATCH 2/5] test using background process --- images_slide_show.sh | 3 +++ requirements.txt | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/images_slide_show.sh b/images_slide_show.sh index f30f84b..7f72e66 100755 --- a/images_slide_show.sh +++ b/images_slide_show.sh @@ -85,6 +85,9 @@ display() { elif [ -n "$image_files" ]; then sudo chvt $unused_tty sudo fbi -a -r 5 -t $DISPLAYTIME --blend $BLENDTIME -T $unused_tty --noverbose "${image_files[@]}" + fbiID=$! + sudo chvt $unused_tty + wait $fbiID elif [ -n "$video_files" ]; then #clear cvlc --loop "$video_files" diff --git a/requirements.txt b/requirements.txt index 5e85305..38f1d43 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,5 @@ google-auth-oauthlib google-auth-httplib2 google-api-python-client Pillow -pyqt5 -Pylint \ No newline at end of file +Pylint +pyqt5 \ No newline at end of file From 74de091cb717808fe803d884784962b661424e53 Mon Sep 17 00:00:00 2001 From: Muddyblack Date: Fri, 12 Jan 2024 21:21:52 +0100 Subject: [PATCH 3/5] debugging aid --- images_slide_show.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/images_slide_show.sh b/images_slide_show.sh index 7f72e66..ff66ebc 100755 --- a/images_slide_show.sh +++ b/images_slide_show.sh @@ -72,6 +72,8 @@ display() { if [ -z "$unused_tty" ]; then echo "No unused TTY found!" return 1 + else + echo "Using TTY $unused_tty" fi if [[ ${#image_files[@]} -gt 0 && ${#video_files[@]} -gt 0 ]]; then From d9fb2de373a45d9325343f1af080ecc7e3353058 Mon Sep 17 00:00:00 2001 From: Muddyblack Date: Fri, 12 Jan 2024 21:27:05 +0100 Subject: [PATCH 4/5] fix --- images_slide_show.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images_slide_show.sh b/images_slide_show.sh index ff66ebc..4440ca5 100755 --- a/images_slide_show.sh +++ b/images_slide_show.sh @@ -79,14 +79,14 @@ display() { if [[ ${#image_files[@]} -gt 0 && ${#video_files[@]} -gt 0 ]]; then while true; do sudo chvt $unused_tty - sudo fbi -a -r 3 -t $DISPLAYTIME --blend $BLENDTIME -T $unused_tty --noverbose -1 "${image_files[@]}" + sudo fbi -a -r 3 -t $DISPLAYTIME --blend $BLENDTIME -T $unused_tty --noverbose -1 "${image_files[@]}" & sleep $((IMAGE_FILES_COUNT * DISPLAYTIME)) sudo pkill -x "fbi" cvlc "$video_files" done elif [ -n "$image_files" ]; then sudo chvt $unused_tty - sudo fbi -a -r 5 -t $DISPLAYTIME --blend $BLENDTIME -T $unused_tty --noverbose "${image_files[@]}" + sudo fbi -a -r 5 -t $DISPLAYTIME --blend $BLENDTIME -T $unused_tty --noverbose "${image_files[@]}" & fbiID=$! sudo chvt $unused_tty wait $fbiID From f3a2de071361ea93997ff384ddd2c5593914bb03 Mon Sep 17 00:00:00 2001 From: Muddyblack Date: Fri, 12 Jan 2024 21:41:17 +0100 Subject: [PATCH 5/5] test with vt --- images_slide_show.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/images_slide_show.sh b/images_slide_show.sh index 4440ca5..160ce22 100755 --- a/images_slide_show.sh +++ b/images_slide_show.sh @@ -78,18 +78,13 @@ display() { if [[ ${#image_files[@]} -gt 0 && ${#video_files[@]} -gt 0 ]]; then while true; do - sudo chvt $unused_tty - sudo fbi -a -r 3 -t $DISPLAYTIME --blend $BLENDTIME -T $unused_tty --noverbose -1 "${image_files[@]}" & + sudo fbi -a -r 3 -t $DISPLAYTIME --blend $BLENDTIME -vt $unused_tty --noverbose -1 "${image_files[@]}" sleep $((IMAGE_FILES_COUNT * DISPLAYTIME)) sudo pkill -x "fbi" cvlc "$video_files" done elif [ -n "$image_files" ]; then - sudo chvt $unused_tty - sudo fbi -a -r 5 -t $DISPLAYTIME --blend $BLENDTIME -T $unused_tty --noverbose "${image_files[@]}" & - fbiID=$! - sudo chvt $unused_tty - wait $fbiID + sudo fbi -a -r 5 -t $DISPLAYTIME --blend $BLENDTIME -vt $unused_tty --noverbose "${image_files[@]}" elif [ -n "$video_files" ]; then #clear cvlc --loop "$video_files"