Keyboard not functional on laptop after suspend/wake up

ZennMystic

Member
Joined
Jul 7, 2021
Messages
42
Reaction score
12
Credits
388
I put Debian 12 on an old HP laptop I have that originally came installed with Windows 7. As I will be traveling soon.
The issue is: If I leave the laptop alone and let it go into suspend the keyboard not longer works at all.

Currently I have to use the virtual keyboard to put in my password and then reboot the machine and the keyboard works again.
I do not have the specs of the laptop with me right now as I'm at work. But I can post if it is needed tonight.

I would like to solve the issue in general, but if nothing else.. In particular at night time I like to use mpv to listen to an audio book. I have a small lua sleeper script running that will close mpv down after that time.

I still want the screen to fade to black so the room is dark. I tried Caffine extension and still allow screen fade but it did not work.. Computer still want into suspend.

If needs be I do realize a work around would be to extend the suspend time or switch it off. But I would rather fix it so that after mvp closes 15 minutes later the computer goes into suspend mode and if I wake up later the keyboard still work.

Any one help? Any ideas?

Thank you for your time.
 


You might need an "echo" before the desktop variable.

echo $DESKTOP_SESSION
 
Last edited:
I should say I did try installing with an other desktop of Cinnamon first. I thought that was the issue so I wiped and reinstalled with the default one gnome. It made no difference.
 
is there a way when I certain program is running to prevent suspend from kicking in? But still allow the screen to turn off?

Chat GTP suggested this lua script for mpv:

-- inhibit_suspend.lua

function on_start()
os.execute("systemd-inhibit --what=idle:handle-suspend-key:handle-lid-switch --mode=block sleep 1d &")
end

function on_exit()
os.execute("pkill -f 'systemd-inhibit --what=idle:handle-suspend-key:handle-lid-switch'")
end

mp.register_event("start-file", on_start)
mp.register_event("shutdown", on_exit)
 
Last edited:
is there a way when I certain program is running to prevent suspend from kicking in? But still allow the screen to turn off?

Chat GTP suggested this lua script for mpv:

-- inhibit_suspend.lua

function on_start()
os.execute("systemd-inhibit --what=idle:handle-suspend-key:handle-lid-switch --mode=block sleep 1d &")
end

function on_exit()
os.execute("pkill -f 'systemd-inhibit --what=idle:handle-suspend-key:handle-lid-switch'")
end

mp.register_event("start-file", on_start)
mp.register_event("shutdown", on_exit)
I honestly don't know.

If you trust the source of the script you can run it and see if it works.
 
I honestly don't know.

If you trust the source of the script you can run it and see if it works.

Yes I tried it.. Nothing it did not change anything....

The link you sent I looked at it most of it is over my head. I would be typing the commands just to try it and see.
 
Yes I tried it.. Nothing it did not change anything....

The link you sent I looked at it most of it is over my head. I would be typing the commands just to try it and see.
Ok, got it.

The thing is (from my own experience) you have to try things with Linux and like you said most of it is over your head.

I'm not so sure that editing the /etc/default/grub file and changing the GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" line and adding to the end of that argument is the answer.

I've tweaked that file a few times and had success but I just don't know if that will fix your issue.
I've disabled the suspend on my laptop and that put a stop to it however, I understand that you would like to fix it not just disable it.

It could be a lightdm issue, or a Xorg issue....and so on.

In the meantime, could you list the spec's of your laptop? Is it a HP? Sony? Dell? How much RAM?

Let's see what @wizardfromoz has to say.
 
Last edited:
He has this to say

G'day ;)

I don't use suspend because I don't use Swap, and you need Swap to suspend.

But I will scout around and return if I have positive input.

Cheers

Wizard

EDITED - hibernate needs swap, not suspend, my bad. I don't use either.
 
Last edited:
I am unfamiliar with Debian 12....

In the menu area ...is there a 'screensaver'...?

If so, adjust the settings there to disable suspend?....or it may be under 'power settings?
 
what command should I run? I ran lshw but it showed a lot....

I found out caffine extension works... But I can't halt suspend and allow blank screen.

I am wondering if it would be worth just turning off suspend
 
Last edited:
After more reading... I have decided to go with the old actinium of Keep It Simple, Stupid.

I have turned off suspend. The screen will still switch off if inactive (wanted this) and for night time and listening to an audio book I wrote a small sleeper auto shut off program for mpv.

This seems to be a on going issue with Debian and laptops as was said earlier. After switching off suspend 99.99% of issues went away.

Thanks to everyone who pitched in.
 
After more reading... I have decided to go with the old actinium of Keep It Simple, Stupid.

I have turned off suspend. The screen will still switch off if inactive (wanted this) and for night time and listening to an audio book I wrote a small sleeper auto shut off program for mpv.

This seems to be a on going issue with Debian and laptops as was said earlier. After switching off suspend 99.99% of issues went away.

Thanks to everyone who pitched in.
You're welcome.
 

Members online


Latest posts

Top