Skip to content

Commit

Permalink
Merge pull request #45 from Muddyblack/33-when-desktop-gui-opened-pro…
Browse files Browse the repository at this point in the history
…blem

33 when desktop gui opened problem
  • Loading branch information
Muddyblack authored Jan 12, 2024
2 parents 1799db2 + f3a2de0 commit 068afe8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
20 changes: 18 additions & 2 deletions images_slide_show.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
else
echo "Using TTY $unused_tty"
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 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 fbi -a -r 5 -t $DISPLAYTIME --blend $BLENDTIME -T 1 --noverbose "${image_files[@]}"
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"
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ google-auth-oauthlib
google-auth-httplib2
google-api-python-client
Pillow
pyqt5
Pylint
Pylint
pyqt5

0 comments on commit 068afe8

Please sign in to comment.