You are not logged in.

#1 2017-08-05 19:34:53

easysid
Member
Registered: 2016-01-01
Posts: 49

Prettier console login screen by modifying /etc/issue

One can display system information, and a distro logo on the console login screen. The idea is simple - Use a script to overwrite /etc/issue before getty starts.

a55dvuFm.png

I wrote a simple script for my system, but I later realized that one can just configure neofetch/screenfetch to do the job (duh).

once you have the script, just use it to populate /etc/issue at boot. If you're on a Debian based system, just call your script in /etc/rc.local. (Debian has a enabled systemd service that executes /etc/rc.local if it exists.)

#!/bin/sh -e
#
# rc.local

# overwrite /etc/issue
yourscript.sh > /etc/issue

exit 0

On other systemd based systems, we can create a service unit that runs before getty.

We can add other stuff like current weather, bitcoin prices etc, but that could add significant delays.

Issues: The /etc/rc.local fires the script just once, before starting the initial tty. On any other ttys started by Ctrl+Alt+Fn, the same old /etc/issue is displayed, giving outdated info. I'll try to see if it can be made more dynamic.

Offline

#2 2017-08-05 19:36:56

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: Prettier console login screen by modifying /etc/issue

Offline

#3 2017-08-05 20:51:41

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: Prettier console login screen by modifying /etc/issue

easysid wrote:

Issues: The /etc/rc.local fires the script just once, before starting the initial tty. On any other ttys started by Ctrl+Alt+Fn, the same old /etc/issue is displayed, giving outdated info. I'll try to see if it can be made more dynamic.

You could add an override to the getty@ttyX.service files (replace X with the TTY number):

# /etc/systemd/system/getty@ttyX.service.d/override.conf

[Service]
Type=
Type=oneshot
ExecStart=
ExecStart=-/usr/bin/agetty --noclear %I $TERM
ExecStart=-/path/to/yourscript.sh

(Untested, I'm not booted with systemd at the moment)

Offline

#4 2017-08-06 06:23:23

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: Prettier console login screen by modifying /etc/issue

^ nice suggestions.

Last edited by ohnonot (2021-07-02 07:49:09)

Offline

Board footer

Powered by FluxBB