Turn Screen OFF on Laptop Lid Close

Hello,
I’ve been searching for 2 days how to make the laptop screen turn off on a lid close event. When closing the lid and it gets to the point where it should normally turn off, the screen quickly blinks off and back on again. The same thing happens when opening the lid at the same point/angle of opening.
I’m hoping someone can help me with this. I don’t really care to have the laptop suspend on lid close, since I’m often doing something that a suspend would interfere with. I like to close the lid, put it down, pick it back up again in a few minutes, etc. To be clear, I’m trying to achieve this in battery mode, but I think it makes since for the screen/backlight to turn off on AC power as well. I’ve tried on both battery and AC and the results are the same as above.

I’m using Tumbleweed (last dup was 2 days ago I believe).
I’m on a Dell M4800 with an intel integrated graphics and amd discrete. $30CupcakeSprinkles

margun@linux-beu5:~> inxi -SG
System:    Host: linux-beu5 Kernel: 5.3.4-1-default x86_64 bits: 64 Desktop: Gnome 3.32.2 Distro: openSUSE Tumbleweed 20191009 
Graphics:  Device-1: Intel 4th Gen Core Processor Integrated Graphics driver: i915 v: kernel 
           Device-2: Advanced Micro Devices [AMD/ATI] Venus XT [Radeon HD 8870M / R9 M270X/M370X] driver: radeon v: kernel 
           Display: wayland server: X.org 1.20.5 driver: radeon resolution: <xdpyinfo missing> 
           OpenGL: renderer: Mesa DRI Intel Haswell Mobile v: 4.5 Mesa 19.1.7 

Hi
Not sure what desktop environment as it may control things, on my laptops I always set to ignore in /etc/systemd/logind.conf file


HandleLidSwitch=ignore

Thanks! I tried that but it had no effect. I also tried logging in to Gnome with X11 instead of Wayland. The only difference is that under X11 the screen doesn’t blink off/on just before the lid closes all the way.
Surely there’s something I can do to fix this, I’m just not sure what. With that setting, does your screen turn off, malcolmlewis?

Hi
I use Xorg on GNOME, I disable the screen lock via settings -> privacy and then in power set screen to blank. I have dual AMD graphics on the laptop running Tumbleweed and don’t see any screen flashing. I wonder if it’s graphics related…

It only flashes for an instant as if it’s trying to blank the screen when closing the lid.
Curious, when you close your lid, does the screen actually blank out?

Hi
Yes it does with about an inch and a half to go. When opening it comes back to life. Wonder if it’s a backlight or acpi issue.

i’m think i’m going to chase the acpi route for now. Sounds promising at least. Thanks for the info–it’s good to know that it works on yours. Took forever to type that, had to take the wrist brace off lol.
I’ll post back once I get a solution in case anyone else is having this issue. I seem to remember my older M4500 Dell having the same problem, but I just ignored it.

You might find that using acpid will do the trick here. (You’d need to install the acpid package first.)

It involves disabling any systemd action on lid close (as already outlined by Malcolm), and a script that will be executed on the lid-closing (and opening) event to turn off (or on) the backlight as required.