marquee-figlet-old 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/bin/bash
  2. wait=5 # before clearing the screen
  3. #~ toiletdelay=4000
  4. pvdelay=10 # scroll lines (per s?) - more is faster
  5. # fonts chosen by: functionality, readability, beauty
  6. figletfonts=( banner banner3-D banner3 banner4 basic bell big block clb8x10 clb8x8 colossal contrast doh doom epic fender fraktur graffiti hollywood italic jazmine larry3d lcd mini nancyj-fancy nancyj-underlined nancyj ogre os2 pebbles poison puffy rev roman script shadow slant small smscript standard starwars straight thick univers utopiab xbriteb xhelvb xsansb )
  7. # sources:
  8. # ftp://ftp.figlet.org/pub/figlet/fonts/ours.tar.gz
  9. # ftp://ftp.figlet.org/pub/figlet/fonts/contributed.tar.gz
  10. # ftp://ftp.figlet.org/pub/figlet/fonts/international.tar.gz
  11. # ftp://ftp.figlet.org/pub/figlet/fonts/ms-dos.tar.gz
  12. # (maybe a package figlet-fonts exists for your distro?)
  13. # and the fonts that come with figlet 2.2.5
  14. #~ toiletfonts=( $(<./goodtoiletfonts) )
  15. #~ fig=0
  16. #~ toi=0
  17. figmax=${#figletfonts[*]}
  18. #~ toimax=${#toiletfonts[*]}
  19. #~ colarray=( 1 2 3 4 5 6 9 10 11 12 13 14 )
  20. colarray=( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 )
  21. #~ colarray=( 1 2 3 4 5 6 )
  22. colmax=${#colarray[*]}
  23. colchoice=$((RANDOM%colmax))
  24. alignarray=(c l r)
  25. alignchoice=$((RANDOM%3))
  26. tput civis # cursor invisible
  27. while :; do
  28. lastalignchoice=$alignchoice
  29. lastcolchoice=$colchoice
  30. #~ sleep $wait
  31. #~ xcalib -red 1 0 $((RANDOM%50)) -green 1 0 $((RANDOM%50)) -blue 1 0 $((RANDOM%50)) -a >/dev/null 2>&1
  32. #~ echo "${toiletfonts[toi]}"
  33. #~ tput setaf $((RANDOM%7 + 1))
  34. #~ toilet -I4 -t -W -F gay -f "${toiletfonts[toi]}" "$(date +"%a, %-d.%-m. %R")"
  35. #~ sleep 0.2
  36. tput cup $(( RANDOM%($(tput lines) - 5) )) 0
  37. #~ tput cup $(tput lines) 0
  38. #~ toilet -t -W -F gay -f "${toiletfonts[toi]}" "$(date +"%a, %-d.%-m. %R") $(date +"%a, %-d.%-m. %R") $(date +"%a, %-d.%-m. %R") $(date +"%a, %-d.%-m. %R")"| pv -l -L $toiletdelay -q
  39. #~ toi=$((toi + 1))
  40. tput setaf ${colarray[colchoice]}
  41. fig="$((RANDOM%figmax))"
  42. figlet -C utf8 -"${alignarray[alignchoice]}" -t -W -f "${figletfonts[fig]}" "$(date +"%a, %-d.%-m. %R")"| pv -l -L $pvdelay -q
  43. #~ (( fig < figmax )) && fig=$((fig + 1)) || fig=0
  44. output=""
  45. if pidof mocp >/dev/null; then
  46. x="$(mocp -Q "%state %title" 2>/dev/null)"
  47. [ "${x%% *}" = "PLAY" ] && output="
  48. MOC:
  49. ${x#* }"
  50. fi
  51. if pidof deadbeef >/dev/null; then
  52. x="$(deadbeef --nowplaying-tf "%isplaying% %artist% - %title%" 2>/dev/null)"
  53. [ "${x%% *}" = "1" ] && output="DeadBeef:
  54. ${x#* }$output"
  55. fi
  56. if [[ "x$output" != "x" ]]
  57. then
  58. #~ sleep 0.5
  59. until [[ "$colchoice" != "$lastcolchoice" ]]; do colchoice=$((RANDOM%colmax)); done
  60. lastcolchoice=$colchoice
  61. echo
  62. tput setaf ${colarray[colchoice]}
  63. fig="$((RANDOM%figmax))"
  64. figlet -C utf8 -"${alignarray[alignchoice]}" -t -W -f "${figletfonts[fig]}" "$output" | pv -l -L $pvdelay -q
  65. #~ (( fig < figmax )) && fig=$((fig + 1)) || fig=0
  66. fi
  67. until [[ "$alignchoice" != "$lastalignchoice" ]]; do alignchoice=$((RANDOM%3)); done
  68. until [[ "$colchoice" != "$lastcolchoice" ]]; do colchoice=$((RANDOM%colmax)); done
  69. #~ echo "${figletfonts[fig]}" && figlet -I4 <-t -W -f "${figletfonts[fig]}" "$output" && tput cols &&
  70. #~ (( fig == figmax )) && fig=0
  71. #~ (( toi == toimax )) && toi=0
  72. #~ for (( i=0 ; i<$(tput lines) ; i++ ))
  73. #~ do
  74. #~ printf "\n"
  75. #~ sleep 0.02
  76. #~ done
  77. sleep $wait
  78. #~ xcalib -c >/dev/null 2>&1
  79. clear
  80. done
  81. tput reset