HDMI display and tty-clock

I have Rock Pi 4B 4GB. I’ve just received external display which is connected via HDMI and offers touch screen via USB (power is through USB). I don’t use the touch.

What I am trying to do is set up a clock on this display. What I have done is:

  1. I’ve put line in crontab:
    * * * * * root /root/clock3
  2. Installed needed packages via apt
  3. File /root/clock3 content is:
    pgrep tty-clock || tty-clock -crs -T /dev/tty1

(Crontab does not need & as all commands are run in background.)

When clock3 is run manually - everything is fine (needed to add & at the end of the command).
But starting from crontab nothing happens.

/var/mail/root says only PID.
/var/log/syslog says nothing.

Any ideas?

In rc.local it also does not work, so I manually start this script:

watch -tn 0.1 " date +%T | figlet ; tail /var/log/apache2/access.log " > /dev/tty1 &

and everything works fine. Not happy I am however that there is no automatic way to start the script on logon or sustain its job via crontab.

The best version I have managed to achieve:

pkill -t tty1
sleep 1
while :; do
    clear
    date +%T | figlet
    tail /var/log/apache2/access.log
    # or htop here, comment two above
    sleep 1
done > /dev/tty1 &
1 Like