How to clear screen on startup?
I want to have a blank screen immediately after startup (clear > /dev/tty1).
No user login or interaction is required.
The boot is to the command line (not the graphic interface).
How do I clear the screen without showing the login prompt?
Also, is it possible to hide all the messages that come up when the system starts?
Thanks
No user login or interaction is required.
The boot is to the command line (not the graphic interface).
How do I clear the screen without showing the login prompt?
Also, is it possible to hide all the messages that come up when the system starts?
Thanks
- DougieLawson
- Posts: 40787
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: How to clear screen on startup?
Try this:
sudo cp /etc/issue /etc/issue~ # take a backup in case we want to return to normal
sudo clear > /etc/issue # write the clear screen codes to /etc/issue
reboot
To return to normal
sudo mv /etc/issue~ /etc/issue
sudo cp /etc/issue /etc/issue~ # take a backup in case we want to return to normal
sudo clear > /etc/issue # write the clear screen codes to /etc/issue
reboot
To return to normal
sudo mv /etc/issue~ /etc/issue
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Re: How to clear screen on startup?
for automated login:yaccri wrote:I want to have a blank screen immediately after startup (clear > /dev/tty1).
No user login or interaction is required.
The boot is to the command line (not the graphic interface).
In Terminal:
sudo nano /etc/inittab
Scroll down to:
1:2345:respawn:/sbin/getty 115200 tty1
and change to
#1:2345:respawn:/sbin/getty 115200 tty1
Under that line add:
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
yaccri wrote:How do I clear the screen without showing the login prompt?
Also, is it possible to hide all the messages that come up when the system starts?
to clear screen:
modify or create /home/pi/.bash_profile and put in:
clear
And save archive and reboot.
Thanks
Re: How to clear screen on startup?
Thanks.DougieLawson wrote:Try this:
sudo cp /etc/issue /etc/issue~ # take a backup in case we want to return to normal
sudo clear > /etc/issue # write the clear screen codes to /etc/issue
reboot
To return to normal
sudo mv /etc/issue~ /etc/issue
There's still 'raspberry pi login:' displayed on the screen. Is it possible to clear the screen completely without showing that prompt?
In addition, is it possible not to display all the startup log (or display just dots or something similar as the startup progresses)?
-
- Posts: 4277
- Joined: Sun Jan 15, 2012 1:11 pm
Re: How to clear screen on startup?
It would be helpful if you'd tell us what problem you're actually trying to solve. What's the real goal here?
These apparently disconnected "Is it possible to ...?" questions are a little frustrating.
Now, granted, it is more or less within the realm of possibility to sort of guess what your goals are, but it is better that we would not have to guess.
These apparently disconnected "Is it possible to ...?" questions are a little frustrating.
Now, granted, it is more or less within the realm of possibility to sort of guess what your goals are, but it is better that we would not have to guess.
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)
(One of the best lines I've seen on this board lately)
Re: How to clear screen on startup?
The goal is to use the rpi as a media player.
It will be connected to a projector. When receiving IR command it will play a movie.
I don't want to display anything before the movie starts, or after it finishes.
It will be connected to a projector. When receiving IR command it will play a movie.
I don't want to display anything before the movie starts, or after it finishes.
-
- Posts: 4277
- Joined: Sun Jan 15, 2012 1:11 pm
Re: How to clear screen on startup?
Why not?
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)
(One of the best lines I've seen on this board lately)
Re: How to clear screen on startup?
Because that's how I want it.
Can we concentrate on the issues?
I look for 2 things:
1. Automaticaly clear the screen after startup, without seeing any prompt. I don't want to see a 'raspberrypi login:' message.
2. If possible, avoid showing the startup messages
I appreciate your help.
Thank you.
Can we concentrate on the issues?
I look for 2 things:
1. Automaticaly clear the screen after startup, without seeing any prompt. I don't want to see a 'raspberrypi login:' message.
2. If possible, avoid showing the startup messages
I appreciate your help.
Thank you.
Re: How to clear screen on startup?
I also use the rpi as a media player, controlling it via 'ssh'
to clear the screen at startup I run
on my system 'raspbian' they need to be run as root
this also clears rpi logo.
not sure about startup messages,
hope this helps
to clear the screen at startup I run
Code: Select all
clear > /dev/tty1
setterm -cursor off > /dev/tty1
this also clears rpi logo.
not sure about startup messages,
hope this helps
Re: How to clear screen on startup?
That's great, but how do I make it run *automatically* at startup?
Re: How to clear screen on startup?
Is there an autostart.sh that this could be added to?
Re: How to clear screen on startup?
No, at least not in /etc/init.d.
Re: How to clear screen on startup?
try taking a look here http://www.akeric.com/blog/?p=1976
- DougieLawson
- Posts: 40787
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: How to clear screen on startup?
If you want to completely disable the login prompt follow http://www.raspberrypi.org/phpBB3/viewt ... 02#p452302 but addyaccri wrote:Thanks.DougieLawson wrote:Try this:
sudo cp /etc/issue /etc/issue~ # take a backup in case we want to return to normal
sudo clear > /etc/issue # write the clear screen codes to /etc/issue
reboot
To return to normal
sudo mv /etc/issue~ /etc/issue
There's still 'raspberry pi login:' displayed on the screen. Is it possible to clear the screen completely without showing that prompt?
In addition, is it possible not to display all the startup log (or display just dots or something similar as the startup progresses)?
1:2345:respawn:/bin/true -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
And that really is an ugly hack.
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Re: How to clear screen on startup?
This throws the message: 'INIT: Id "1" respawning too fast: disabled for 5 minutes'.
After 5 minuter, the message repeats.
After 5 minuter, the message repeats.
Re: How to clear screen on startup?
This simple solution at http://ananddrs.com/2013/09/18/rpi-hide-boot-msg/ worked for me. It hides all boot messages.
I still need to get rid of the login prompt.
I still need to get rid of the login prompt.
Re: How to clear screen on startup?
Run 'sudo raspi-config', and make sure that the 'Boot to desktop' option is selected yes. It may be in advanced settings.
I'm happy to help.
https://www.raspberrypi.org/forums/viewtopic.php?f=78&t=51794 - List of games that work on the Pi.
https://www.raspberrypi.org/forums/viewtopic.php?f=78&t=51794 - List of games that work on the Pi.
Re: How to clear screen on startup?
Doesn't boot to desktop mean boot to the graphical UI?
I don't want to use startX. Only a blank screen is required.
I don't want to use startX. Only a blank screen is required.
Re: How to clear screen on startup?
did you ever get this working? I am also working on a system where i need to have completely clean output during boot. i have manged to get very near to my final goal by rediecting all mesages to TTY3 during boot by editing /boot/cmdline.txt and changing/adding the following
i dont actually need to login to tty1, so i also comment it out in /etc/inittab and make tty3 my main console for messeages and so use --noclear to keep boot messages from the kernel. i can swap to using it ALT-F3 if i need to, but mainly i administer using SSH
this seems to work ok so far. I would still like to find a way to completely clear tty1 from another console or SSH if i need to though.
Code: Select all
console=tty3 vt.global_cursor_default=0 quiet
Code: Select all
#1:2345:respawn:/sbin/getty --noclear 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
#3:23:respawn:/sbin/getty 38400 tty3
3:2345:respawn:/sbin/getty --noclear 38400 tty3
Re: How to clear screen on startup?
Don't know if this helps...
I have an elderly friend who likes to watch movies but doesn't know about computers at all. I set her up with a RPi with an 2GB SD card with a minimal raspbian image on it. The image automatically logs into tty1, blanks the screen, and places the cursor right in the middle of the screen without a prompt. Then it mounts the usb key (which is where the movie is stored) and plays the movie file with omxplayer (only one movie is allowed on the flash key at a time). So basically she makes sure her TV is on the proper source, and turns on the RPi (which is plugged into a power bar so she can just flip the power switch). The movie is them played for her.
The mount and running the movie isn't important, but I will post the code for blanking the screen on login if people are interested. It is written in PERL (natch).
First, make sure auto login to a command line is enabled. Edit the inittab file with this command:
sudo nano /etc/inittab
Find this line (assuming you haven't changed it before):
1:2345:respawn:/sbin/getty --noclear 38400 tty1
and add a # to the start:
#1:2345:respawn:/sbin/getty --noclear 38400 tty1
Then paste the following below that line:
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
Save the file. Now we need to add a script to run once we log in. So we are going to edit the profile file:
sudo nano /etc/profile
Add the following line to the end of the file and save it:
/home/pi/o1
Then we must create the script:
nano /home/pi/o1
Paste the following code into the file and save it:
Then issue this command to make it executable:
chmod 755 /home/pi/o1
That's it, just reboot and give it a try. Hope this helps. This doesn't work for ssh (although, it might be possible?!?).
I have an elderly friend who likes to watch movies but doesn't know about computers at all. I set her up with a RPi with an 2GB SD card with a minimal raspbian image on it. The image automatically logs into tty1, blanks the screen, and places the cursor right in the middle of the screen without a prompt. Then it mounts the usb key (which is where the movie is stored) and plays the movie file with omxplayer (only one movie is allowed on the flash key at a time). So basically she makes sure her TV is on the proper source, and turns on the RPi (which is plugged into a power bar so she can just flip the power switch). The movie is them played for her.
The mount and running the movie isn't important, but I will post the code for blanking the screen on login if people are interested. It is written in PERL (natch).
First, make sure auto login to a command line is enabled. Edit the inittab file with this command:
sudo nano /etc/inittab
Find this line (assuming you haven't changed it before):
1:2345:respawn:/sbin/getty --noclear 38400 tty1
and add a # to the start:
#1:2345:respawn:/sbin/getty --noclear 38400 tty1
Then paste the following below that line:
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
Save the file. Now we need to add a script to run once we log in. So we are going to edit the profile file:
sudo nano /etc/profile
Add the following line to the end of the file and save it:
/home/pi/o1
Then we must create the script:
nano /home/pi/o1
Paste the following code into the file and save it:
Code: Select all
#!/usr/bin/perl
use utf8;
use 5.010;
use strict;
#use autodie;
use warnings;
#use diagnostics;
print "\033[2J"; #clear the screen
print "\033[20;50H"; #jump to middle of TV screen
# This line is here to stop the command prompt, until the ENTER key is hit.
my $temp = <STDIN>;
exit 0;
chmod 755 /home/pi/o1
That's it, just reboot and give it a try. Hope this helps. This doesn't work for ssh (although, it might be possible?!?).
We 'idiot proofed' the world, and now it's full of idiots!
Re: How to clear screen on startup?
Create an issue file which disables the blinking cursor and sets the text color to black:
Modify /etc/inittab so that the issue file generated above is used on tty1:
Take the new init configuration into use:
Code: Select all
echo -e '\033[?17;0;0c\033[0;30m' > /etc/issue.tty1
Code: Select all
1:2345:respawn:/sbin/getty -f /etc/issue.tty1 38400 tty1
Code: Select all
init q
killall getty
Re: How to clear screen on startup?
Thanks DeanC and Vesuri, these two solutions work for me and give me options (blinking cursor or complete blank screen, depending on my current project needs.)
Re: How to clear screen on startup?
I may be late to this party but I had the same need as the OP and came across this thread. It helped me come up with a solution which I will share because things have changed since this thread was started, For one thing there is no inittab anymore in Raspbian Buster. There wasn't in Stretch either.
The need, for those that think they need to know why, is... I run Kodi on boot on a Pi 3 with their 7" touchscreen. The Pi boots to CLI no autologin. As such the status/remnants of the boot processes are on the TS along with the enter username/password prompt.
Then Kodi starts. All is fine because Kodi covers that all up. Until... And, if Kodi is using a "Dim" screensaver. Then when Kodi Dims you see all the boot stuff and login stuff more so then the dimmed out Kodi. That. Looks. Bad. Period.
So what I did was this. In /etc/rc.local I added this just before the exit 0:
The script /usr/local/bin/ClearScreen contains this:
Set the permissions to 700 and owner root:staff on /usr/local/bin/ClearScreen.
So, the screen is cleared by the lines in rc.local but after rc.local is executed and has completed more boot status lines appear and then the login request appears. The /usr/local/bin/ClearScreen script is spawned from rc.local allowing rc.local to complete then 10 seconds later the screen is cleared again.
This works. YMMV Once Kodi starts if Kodi's screensaver dims you see nothing from/in the background. If you exit Kodi you get a blank screen that on the TS even touching it does not cause anything to appear. I haven't tested that extensively because, well, I don't need anything to show up.
This Pi has no keyboard/mouse associated with it because it's purpose in life is to be a media client, nothing more. If I need to access it I SSH in. It's networking is set up static for wired and DHCP for wireless allowing two ways to access it if needed.
I posted this in case others need to do this and discover this thread like I did.
The need, for those that think they need to know why, is... I run Kodi on boot on a Pi 3 with their 7" touchscreen. The Pi boots to CLI no autologin. As such the status/remnants of the boot processes are on the TS along with the enter username/password prompt.
Then Kodi starts. All is fine because Kodi covers that all up. Until... And, if Kodi is using a "Dim" screensaver. Then when Kodi Dims you see all the boot stuff and login stuff more so then the dimmed out Kodi. That. Looks. Bad. Period.
So what I did was this. In /etc/rc.local I added this just before the exit 0:
Code: Select all
/usr/bin/clear > /dev/tty1
/usr/bin/setterm -cursor off > /dev/tty1
/usr/local/bin/ClearScreen &
Code: Select all
#!/bin/bash
/bin/sleep 10
/usr/bin/clear > /dev/tty1
/usr/bin/setterm -cursor off > /dev/tty1
exit 0
So, the screen is cleared by the lines in rc.local but after rc.local is executed and has completed more boot status lines appear and then the login request appears. The /usr/local/bin/ClearScreen script is spawned from rc.local allowing rc.local to complete then 10 seconds later the screen is cleared again.
This works. YMMV Once Kodi starts if Kodi's screensaver dims you see nothing from/in the background. If you exit Kodi you get a blank screen that on the TS even touching it does not cause anything to appear. I haven't tested that extensively because, well, I don't need anything to show up.
This Pi has no keyboard/mouse associated with it because it's purpose in life is to be a media client, nothing more. If I need to access it I SSH in. It's networking is set up static for wired and DHCP for wireless allowing two ways to access it if needed.
I posted this in case others need to do this and discover this thread like I did.