Laptop monitor doesn't resume on wake, HDMI monitor does

I have a clean install of Xubuntu-minimal 24.04 with XFCE desktop environment running on an ASUS Tuf Gaming A15 laptop with a Samsung monitor plugged in via HDMI and working as the primary monitor.

I’m running an Nvidia GeForce GTX 1650 Ti Mobile GPU.

  • I close the laptop lid, both monitors go to sleep;
  • I open laptop lid, only the Samsung HDMI monitor wakes up, the laptop monitor doesn’t.

If I run arandr I can switch it back on or fix.
When I look in ‘Display’, I find the laptop screen has been ‘Disabled’. So closing the laptop lid doesn’t put the laptop screen to sleep or suspend, it disables it completely until I manually enable it again.

Regardless of what I set in arandr or Display, it is forgotten on wake.

I have tried all sorts - screen saver off at startup, power manager off, power manager on - but no diff. I have tried numerous things I have found online, all to no avail.

Any help greatly appreciated.

PS: This is a clean install of 24.04, but the same thing was happening in Xubuntu-core 20.04 (which isn’t around any more) previously, and I never found a fix for that, either. Hoping I might get somewhere this time.

You can try the following workarounds in the meantime, as this looks like a known interaction issue between XFCE, lid events, and NVIDIA, rather than a hardware fault. Hopefully one of these helps until someone more specialized can dig deeper.

1. Ignore lid-close handling (recommended first test)

It seems the system is disabling the internal display instead of suspending it.

Edit logind configuration:

sudo nano /etc/systemd/logind.conf

Set or add:

HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore

Then restart logind or reboot:

sudo systemctl restart systemd-logind

2. Disable XFCE lid actions (to avoid conflicts)

XFCE Power Manager can override system behavior.

Run:

xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/lid-action-on-ac -s 0
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/lid-action-on-battery -s 0

Log out and back in (or reboot).


3. Force the laptop display back on after resume (practical workaround)

Since arandr fixes it manually, you can automate that.

Check your internal display name:

xrandr

Then create a small script, for example:

nano ~/.local/bin/fix-display.sh
#!/bin/sh
xrandr --output eDP-1 --auto

Make it executable:

chmod +x ~/.local/bin/fix-display.sh

Add it to Session and Startup → Application Autostart.


These are not perfect fixes, but they often work around this exact behavior. They should help until someone with deeper XFCE/NVIDIA experience can provide a more permanent solution.

Hi. Thanks for the input.

  1. Didn’t work.
  2. After inputting those two commands and rebooting, the laptop screen is disabled after I login. I run my script in arandr and enable both monitors again.

Then …

  • When I close the laptop lid, the HDMI external monitor STAYS ON and the computer doesn’t go to standby (although its screen goes to sleep).
  • When I open the laptop lid, the laptop screen comes back on again.

Haven’t tried 3. yet, but can see what you’re saying (arandr actually has the script available to use already).

  • So, my question now is: How do I reverse whatever the second method did to my machine? Want the machine going to standby when the lid is closed and both monitors sleeping. A priority.

Update: I fiddled with Power Manager and set the system to Suspend when laptop lid shut. It was set to shutdown. Now, back to square one:

When I close the laptop lid, machine sleeps and both monitors go off. When I open the lid, HDMI external monitor wakes, laptop monitor doesn’t.

Thanks for testing and reporting back.

Method #2 only changed XFCE Power Manager settings. To fully revert it, just open Settings → Power Manager and set “When laptop lid is closed” → Suspend (for both AC and battery), or reset it with:

xfconf-query -c xfce4-power-manager -R -p /

What you’re seeing now is expected:

  • Suspend on lid close works :heavy_check_mark:
  • Both screens sleep :heavy_check_mark:
  • On resume, only the HDMI monitor wakes :x:

So the remaining issue is display re-enable after resume, not suspend itself.

Since arandr fixes it instantly, an xrandr script on resume (method #3) is currently the most practical workaround until someone with deeper XFCE/NVIDIA knowledge provides a permanent fix.

I figured. Thanks. I’ll give 3. a try.

  • I set the screens up in arandr
  • Then ‘File>Save as …’> name the script and …
  • arandr creates a shell script @ /home//.screenlayout//
  • The shell script contains the following command.
#!/bin/sh
xrandr --output eDP --mode 1920x1080 --pos 1920x0 --rotate normal --output HDMI-A-0 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-1-0 --off --output DP-1-1 --off

Should the entry for the display port at the end of the command - DP-1-0 --off --output DP-1-1 --off - be there? … because

  • eDP = the laptop monitor;
  • HDMI = the external monitor;
  • DP doesn’t exist.

There is no display port monitor connected. Anyway …

  • I open Sessions and Startup> Application Autostart> Add

Question: Do I add the path to the shell script and the shell script name or the command contained in the shell script in the ‘Command’ box?

I tried adding just the command at the ‘Command’ box and it made no difference to my issue.

Cheers.

PS: Just to add, the laptop screen is disabled at boot now. Not sure what happened along the way, but when I switch on the machine, only the HDMI external monitor comes up.

this is expected behavior from arandr.

About the DP-1-0 / DP-1-1 --off entries
Yes, they’re fine to be there. arandr writes a full layout and explicitly turns all other possible outputs off, even if they aren’t physically connected. They won’t cause problems.

What to put in “Command” (this part matters)
You should add the path to the script, not the raw xrandr command.

Example:

/home/USERNAME/.screenlayout/your-script-name.sh

Make sure it’s executable:

chmod +x ~/.screenlayout/your-script-name.sh

Running the command directly in Autostart often fails because the X session isn’t fully ready yet — the script approach is more reliable.

Laptop screen disabled at boot
That usually means XFCE saved a bad display state.

Quick fix:

mv ~/.config/monitors.xml ~/.config/monitors.xml.bak

Then reboot. XFCE will recreate it with sane defaults.

After that, keep the arandr script in Application Autostart — it’s currently the most reliable workaround for NVIDIA + XFCE forgetting the internal display after suspend.

Thanks. Haven’t tried solution 3 yet as been too busy, but will do so later tonight. In the meantime, I discovered something completely by accident.

With the lid down and the machine in standby, I accidentally hit the external keyboard I have plugged in to the laptop (not the laptop keyboard, obviously enough) and, as expected, the machine came on. The external monitor came on.

Here’s the strange part: When I lifted the laptop lid at this point, with the external monitor on by accident, the laptop monitor snapped out of standby as expected, lit up and acted as expected!

Don’t know what’s happening there, but it’s a tedious workaround. Tap the external keyboard and wait for the external monitor to boot up prior to opening the laptop lid and everything should work as per normal.

I’ll try method 3 tonight sometime.

That’s actually a very useful discovery :+1:

What it suggests is that resume triggered by an external input (USB keyboard) wakes the GPU and display stack before the lid event is processed. When you then open the lid, the internal panel is re-enabled correctly.

Your workaround makes sense but, as you said, it’s tedious.
Method #3 (forcing xrandr after login/resume) is still the most practical way to normalize the display state until someone with deeper XFCE/NVIDIA knowledge confirms a proper fix or upstream bug.

One question: If I get no screens and can’t use the computer after trying method 3 and rebooting, how do I reverse it?