This guide demonstrates how to disable the HDMI power saving mode on Lubuntu and automatically execute a script during system startup to ensure the screen remains active.
-
Open a terminal.
-
Create a Bash script named
prevent_hdmi_sleep.sh
:nano ~/prevent_hdmi_sleep.sh
-
Add the following content:
#!/bin/bash # Disable HDMI power saving mode xset -display :0.0 dpms 0 0 0
-
Save the script (Ctrl + O in Nano) and exit the editor (Ctrl + X).
-
Make the script executable:
chmod +x ~/prevent_hdmi_sleep.sh
-
Open the autostart directory:
mkdir -p ~/.config/autostart/
-
Create a new desktop file
prevent_hdmi_sleep.desktop
in the autostart directory:nano ~/.config/autostart/prevent_hdmi_sleep.desktop
-
Add the following content:
[Desktop Entry] Type=Application Exec=sh -c "sleep 5 && $HOME/prevent_hdmi_sleep.sh" Hidden=false NoDisplay=false X-GNOME-Autostart-enabled=true Name=Prevent HDMI Sleep Comment=Prevents HDMI power saving mode.
Exec=sh -c "sleep 5 && $HOME/prevent_hdmi_sleep.sh"
: This line executes the script located in the user's home directory ($HOME
). Usingsh -c "sleep 5 && ..."
ensures the script runs with a slight delay after desktop startup (in this case, 5 seconds).
-
Save the file (Ctrl + O in Nano) and exit the editor (Ctrl + X).
-
Ensure the script and the
.desktop
file are correctly created and configured:ls -l ~/prevent_hdmi_sleep.sh ls -l ~/.config/autostart/prevent_hdmi_sleep.desktop cat ~/.config/autostart/prevent_hdmi_sleep.desktop
-
Restart your Lubuntu system and verify if the HDMI screen remains active and does not enter standby mode.
-
After restarting, check the DPMS settings again to ensure Standby, Suspend, and Off are set to 0:
xset -display :0.0 q
Ensure the values now appear as follows:
DPMS (Energy Star): Standby: 0 Suspend: 0 Off: 0 ...
This guide provides a reliable method to deactivate the HDMI power saving mode on Lubuntu and ensure the settings persist after system restarts.