|
1 | 1 | == Screen blanking |
2 | 2 |
|
3 | | -You can configure your Raspberry Pi to blank the screen after a period of inactivity. By default, Raspberry Pi OS blanks the screen after ten minutes of inactivity when screen blanking is enabled. |
| 3 | +You can configure your Raspberry Pi to blank the screen after a period of inactivity. When screen blanking is enabled, Raspberry Pi OS blanks the screen after ten minutes of inactivity by default. |
4 | 4 |
|
| 5 | +How you manage screen blanking depends on your setup: |
| 6 | + |
| 7 | +* In the <<desktop, desktop environment>>, you can configure screen blanking with graphical tools or from the command line. |
| 8 | +* In <<console, console mode>> (text-only without the desktop), screen blanking is controlled through kernel parameters. |
| 9 | +
|
| 10 | +[[desktop]] |
5 | 11 | === Desktop |
6 | 12 |
|
7 | | -You can control screen blanking using the *Screen Blanking* option in Control Centre. |
| 13 | +When running Raspberry Pi OS using the desktop environment, you can control screen blanking through built-in configuration tools: the graphical menu (*Control Centre*) or the command-line interface (*CLI*). |
| 14 | + |
| 15 | +If you aren't running the desktop environment, you can manage screen blanking from the terminal interface on your Raspberry Pi. For instructions, see <<console, Console>>. |
8 | 16 |
|
9 | 17 | ==== Control Centre |
10 | 18 |
|
11 | | -Click the Raspberry Pi button in the menu bar. Navigate to *Preferences* > *Control Centre*. |
| 19 | +The *Control Centre* application allows you to turn screen blanking on or off without editing configuration files manually. |
| 20 | + |
| 21 | +1. Select the Raspberry Pi icon in the top-left corner of the menu bar. |
| 22 | +2. Go to *Preferences > Control Centre*. |
| 23 | ++ |
| 24 | +image::images/pi-configuration.png[opening the Control Centre application from the desktop] |
| 25 | +3. Open the *Display* tab in the *Control Centre* window. |
| 26 | +4. Use the toggle to turn on *Screen Blanking*. |
| 27 | +5. Select *Close* to confirm your selection. |
| 28 | ++ |
| 29 | +image::images/blanking.png[toggle Screen Blanking on in the Control Centre application] |
12 | 30 |
|
13 | 31 | NOTE: In previous versions of Raspberry Pi OS, the Control Centre application was called Raspberry Pi Configuration. |
14 | 32 |
|
15 | | -image::images/pi-configuration.png[opening the Control Centre menu from the desktop] |
| 33 | +==== CLI |
16 | 34 |
|
17 | | -Select the *Display* tab. Toggle the *Screen Blanking* radio button into the on position. Press *OK* to confirm your selection. |
| 35 | +If you prefer using the terminal, use the `raspi-config` command-line tool to enable or disable screen blanking. This method is useful when working remotely over SSH or when you want quick access to system settings. |
18 | 36 |
|
19 | | -image::images/blanking.png[toggle Screen Blanking on in the Control Centre menu] |
| 37 | +1. Run the following command to open the tool: `sudo raspi-config`. |
| 38 | +2. Navigate with the arrow keys and press **Enter** or **Return** to select `Display Options` *>* `Screen Blanking`. |
| 39 | +3. Use the arrow keys on your keyboard to either: |
| 40 | + - Choose `yes` to enable screen blanking. |
| 41 | + - Choose `no` to disable screen blanking. |
20 | 42 |
|
21 | | -==== CLI |
| 43 | +[[console]] |
| 44 | +=== Console |
| 45 | + |
| 46 | +You can control screen blanking in *console mode* using the `consoleblank` kernel parameter. |
| 47 | + |
| 48 | +Unlike the screen blanking setting modified by the Control Centre and `raspi-config`, which only affects desktop sessions, the `consoleblank` parameter applies when your Raspberry Pi is running with a monitor and keyboard in a text-only terminal session. By setting `consoleblank` in the kernel command line, you can specify how long the console waits before turning off the screen. |
22 | 49 |
|
23 | | -You can enable and disable screen blanking with the `raspi-config` CLI tool. Run the following command to open the tool: |
| 50 | +==== Set console mode screen blanking |
| 51 | + |
| 52 | +To change the console mode screen blanking configuration: |
| 53 | + |
| 54 | +1. Use the following command to open `/boot/firmware/cmdline.txt` in a text editor as an administrator: `sudo nano /boot/firmware/cmdline.txt`. |
| 55 | +2. Set the number of seconds before Raspberry Pi OS blanks the console. All parameters must remain on a single line. You can: |
| 56 | + * Set how many seconds of inactivity before the screen blanks. For example, adding `consoleblank=600` blanks the screen after 600 seconds of inactivity. |
| 57 | + * Add `consoleblank=0` to never blank the screen. |
| 58 | +3. Use the following command to reboot the Raspberry Pi: `sudo reboot`. This is a necessary precursor for the changes to take effect. |
| 59 | + |
| 60 | +After reboot, the console blanking timeout follows your new setting. |
| 61 | + |
| 62 | +==== View the current screen blanking setting |
| 63 | + |
| 64 | +You can display the current console blank time (in seconds) with the following command: |
24 | 65 |
|
25 | 66 | [source,console] |
26 | 67 | ---- |
27 | | -$ sudo raspi-config |
| 68 | +$ cat /sys/module/kernel/parameters/consoleblank |
28 | 69 | ---- |
29 | 70 |
|
30 | | -Use the arrow keys to navigate and the *Enter* key to select. Select `Display Options` > `Screen Blanking`. Choose `yes` with the arrow keys to enable screen blanking, or `no` to disable screen blanking. |
| 71 | +== Custom fullscreen splash image |
31 | 72 |
|
32 | | -=== Console |
| 73 | +You can configure your Raspberry Pi to display a fullscreen splash image during boot instead of the standard console log messages. |
33 | 74 |
|
34 | | -The `dpms_timeout` screen blanking configuration only affects desktop sessions. In *console mode*, when your Raspberry Pi is connected to a monitor and keyboard with only a terminal for input, use the `consoleblank` setting in the kernel command line. |
| 75 | +[[file-reqs]] |
| 76 | +=== File requirements |
35 | 77 |
|
36 | | -==== Set console mode screen blanking |
| 78 | +The splash screen image must meet the following criteria: |
37 | 79 |
|
38 | | -To change the console mode screen blanking configuration, open `/boot/firmware/cmdline.txt` in a text editor as an administrator: |
| 80 | +* *Maximum dimensions.* 1920 × 1080 pixels. |
| 81 | + - If the image is smaller than the screen, the remaining area around your image is filled with a solid color taken from the top-left pixel of your image `(0, 0)`. |
| 82 | + - Scaling isn't applied. If the screen is smaller than the image, the image is clipped and centred. |
| 83 | +* *Maximum colours.* 224 unique colours. |
| 84 | +* *Colour depth.* 24-bit (8 bits per channel, no alpha channel). |
| 85 | +* *Format.* Uncompressed TGA. |
| 86 | + |
| 87 | +You can use ImageMagick's `convert` command to convert an image to the TGA format expected by the kernel. For example, to convert `image.png` to a suitably-formatted `splash-image.tga` file: |
39 | 88 |
|
40 | 89 | [source,console] |
41 | 90 | ---- |
42 | | -$ sudo nano /boot/firmware/cmdline.txt |
| 91 | +$ sudo apt install imagemagick |
| 92 | +$ convert image.png -colors 224 -depth 8 -type TrueColor -alpha off -compress none -define tga:bits-per-sample=8 splash-image.tga |
43 | 93 | ---- |
44 | 94 |
|
45 | | -You can adjust the number of seconds before Raspberry Pi OS blanks the console here. For instance, add `consoleblank=600` to disable display output after 600 seconds of inactivity. Set the value to `0` to never blank the screen. |
| 95 | +=== Set up a fullscreen splash image |
| 96 | + |
| 97 | +There are two ways to enable a fullscreen splash image on your Raspberry Pi. Depending on your technical expertise, you can either: |
| 98 | + |
| 99 | +* <<apt-package, *Use the apt package>>.* This method is more straightforward, allowing you to enable the splash screen with minimal configuration. You install a pre-made package (`rpi-splash-screen-support`) that automates most of the setup. It copies your image, sets kernel parameters, and configures the system for you. |
| 100 | +* <<cli, *Edit the `cmdline.txt` system file>>.* This method is more technical, but gives you control over every step. You manually configure the splash image on the command line and then update your `initramfs` to contain the splash image. |
46 | 101 |
|
47 | | -Changes to `cmdline.txt` only take effect after a reboot. Use the following command to reboot your Raspberry Pi: |
| 102 | +[[apt-package]] |
| 103 | +==== Use the apt package |
48 | 104 |
|
| 105 | +Install the `rpi-splash-screen-support` package to simplify the set up of fullscreen splash images. The package provides the `configure-splash` tool, which sets the necessary kernel parameters and updates your `initramfs`. |
| 106 | + |
| 107 | +1. Install the package using the following command: |
| 108 | ++ |
| 109 | +[source,console] |
| 110 | +---- |
| 111 | +$ sudo apt install rpi-splash-screen-support |
| 112 | +---- |
| 113 | +2. After the apt package is installed, run the following command to configure your splash image, replacing `<splash-image.tga>` with the name or path of the image file. This path can be relative or absolute: |
| 114 | ++ |
| 115 | +[source,console] |
| 116 | +---- |
| 117 | +$ sudo configure-splash <splash-image.tga> |
| 118 | +---- |
| 119 | +3. Run the following command to reboot your Raspberry Pi and see the splash image: |
| 120 | ++ |
49 | 121 | [source,console] |
50 | 122 | ---- |
51 | 123 | $ sudo reboot |
52 | 124 | ---- |
53 | 125 |
|
54 | | -==== View current screen blanking setting |
55 | | - |
56 | | -You can display the current console blank time in seconds with the following command: |
57 | | - |
58 | | -[source,console] |
| 126 | +If the image appears upside down when booting, edit the `convert` command in <<file-reqs, File requirements>> to add the `-flip` flag before the `splash-image.tga`. Then run `configure-splash` to update the image with the correct orientation. |
| 127 | + |
| 128 | +[[cli]] |
| 129 | +==== Edit the `cmdline.txt` system file |
| 130 | + |
| 131 | +The following method requires editing system files and manually updating the `initramfs`. |
| 132 | + |
| 133 | +1. Use the following command to open `/boot/firmware/cmdline.txt` in a text editor as an administrator: `sudo nano /boot/firmware/cmdline.txt`. |
| 134 | +2. Disable on-screen console messages to prevent boot messages from covering your splash image. Edit `cmdline.txt` to remove the following: |
| 135 | + - `console=tty1`. |
| 136 | + - `quiet` (if present). |
| 137 | + - Any references to `plymouth`, such as `plymouth.ignore-serial-consoles`. |
| 138 | +3. Edit `cmdline.txt` to add the following parameters: |
| 139 | + - `fullscreen_logo_name=logo.tga fullscreen_logo=1` to enable fullscreen splash. |
| 140 | + - `vt.global_cursor_default=0` to remove the flashing cursor in the splash image. |
| 141 | ++ |
| 142 | +Your entry should end with something like the following: |
| 143 | ++ |
| 144 | +[source] |
59 | 145 | ---- |
60 | | -$ cat /sys/module/kernel/parameters/consoleblank |
| 146 | +fullscreen_logo_name=logo.tga fullscreen_logo=1 vt.global_cursor_default=0 |
61 | 147 | ---- |
| 148 | +4. Place the image file in the correct location. |
| 149 | + - The kernel expects the image file in `/lib/firmware`. |
| 150 | + - The TGA file is read from the `initramfs` during boot. |
| 151 | + - The filename must match fullscreen_logo_name in `cmdline.txt`. |
| 152 | + |
| 153 | +For example code for embedding TGA images in `initramfs`, see the https://github.com/raspberrypi/rpi-splash-screen-support/blob/master/configure-splash[Raspberry Pi splash screen support tool] in GitHub. |
| 154 | + |
| 155 | +NOTE: *Step 2* doesn't prevent `getty` from launching a login prompt. Your splash image appears during boot, but when the system is ready for login, the console takes over, and the splash disappears. `getty` clears the splash screen and writes the login prompt over it when the system is ready. |
| 156 | + |
0 commit comments