Change default font terminal in DietPI

:thinking:

Uhm thanks! Then it’s weird. But did you try to display the output to an external monitor? Because also for me was working if launched from my computer, not on the script that runs locally on the RPi.

Or maybe it’s because I used the code as a variable.

 boot_time=$(systemd-analyze | awk '{print $NF;exit}')

Or maybe I simply done an error when I inserted inside my script :smiley:
I’ll investigate it later at home.

I would recommend to always specify the full path of the program you like to execute on a script. Could be that the command systemd-analyze alone is not recognised within the script. Just use which systemd-analyze to find the correct location.

root@DietPi3:~# which systemd-analyze
/usr/bin/systemd-analyze
root@DietPi3:~#

:slight_smile:

got it working, but in order to run in to attached display it needs sudo privileges, don’t ask me why :open_mouth:




boot_time=$(sudo /usr/bin/systemd-analyze | awk '{print $NF;exit}')

without sudo

It’s not very nice that the bash command grabs the time in “4.123s” and my goal is to get “4.123” without the “s”, I tried lots of commands but I’m not that able with bash :thinking: :frowning:

This should works:

root@DietPi:~# (/usr/bin/systemd-analyze | awk '{gsub(/[^0-9. ]/,"")}NR==1, NF' )
   1.144   3.187   4.331

Because the NF should print only the last field, but I don’t understand why it prints all the number instead only the last field :thinking:

PS: full output is this:

Startup finished in 1.144s (kernel) + 3.187s (userspace) = 4.331s
graphical.target reached after 3.162s in userspace

For non-root to call systemd-analyze, I guess dbus and systemd-logind is required:

sudo apt install dbus
systemd-analyze

If that doesn’t work yet:

sudo systemctl unmask systemd-logind
sudo systemctl start systemd-logind
systemd-analyze

Try the following to show the last field of the first line without unit:

systemd-analyze | mawk 'NR==1{gsub(/[^0-9. ]/,"");print $NF}'

Your command to show only the last field without letters works perfectly, thank you!

About running systemd as root, if it isn’t a problem for the security, I prefer not to install other software, in order to keep going with the Diet(Pi) :smiley: I noticed that my script was already running some command (to show Unbound info) as root!

Thanks for the help :slight_smile:

Finally I completed the script with RAMlog size, boot time, and some useful info:

And I wrote a little blog post about the Raspberry Pi OS 11 bug with this display and DietPi: Fix Pimoroni HyperPixel display with Raspberry Pi OS 11 Bullseye

Thanks to all for the help, I also made a small (what I can…) donation to the DietPI project :slight_smile: Hope this help the project to keep going for now!

thx for sharing the nice little blog post and of course for the donation. :slight_smile:

Many thanks. Btw, dbus and systemd-logind are both provided by the systemd project, natively provided and by default pre-installed on Debian to manage certain non-root system access. We disable it by default mostly to save the additional ~10 MiB RAM usage by the two processes, not so much for security concerns. When installing desktops and other X applications, those are installed and enabled by DietPi-Software as well, simply required for non-root X sessions. I.e. if it helps in your case, no need to worry, it is the intended way to get this working :slight_smile:.