Problem after waking up from sleep---help

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
johninfant

Problem after waking up from sleep---help

Post by johninfant »

Hi friends.

This time my issue is, my battery module is not loaded after every wakeup from suspend..

Please help...
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Husse

Re: Problem after waking up from sleep---help

Post by Husse »

I suppose you mean that the battery is not fully charged
Now this must be divided into two problems
The laptop is connected to main, so your problem is that it is not being charged
The laptop is not connected to main so your problem is that it is being drained of charge - and depending on what you mean by sleep that may be no error because if you use suspend to RAM some power is used
Please clarify
johninfant

Re: Problem after waking up from sleep---help

Post by johninfant »

Actually, I mean, charging and discharging are fine... Just I don't see the charging, discharging battery states in notification area... even batter level is not displayed in gadgets.. this happens when i suspend my laptop and wake up again.
Husse

Re: Problem after waking up from sleep---help

Post by Husse »

I'll see if I can find something
Husse

Re: Problem after waking up from sleep---help

Post by Husse »

Silly me - I forgot to ask you if you have gnome or KDE or something else
I've done some investigating but not yet found something
johninfant

Re: Problem after waking up from sleep---help

Post by johninfant »

I am using Mint Gnome..
piratesmack

Re: Problem after waking up from sleep---help

Post by piratesmack »

Does Mint use pm-utils?

Try putting a script like this in /etc/pm/sleep.d

Code: Select all

#!/bin/sh

export PATH=/bin:/sbin:/usr/bin:/usr/sbin

case $1 in
  #commands you want run at suspend or hibernate
  suspend | hibernate)
    #unload battery module
    rmmod battery
  ;;
  #commands you want run at resume
  resume | thaw)
    #reload battery module
    modprobe battery
  ;;
esac
Make sure it's executable:

Code: Select all

sudo chmod +x /etc/pm/sleep.d/yourscipt.sh
I use a similar script to restart my wireless after suspending.

Here's more information on pm-utils hooks:
http://wiki.archlinux.org/index.php/Pm- ... _own_hooks
Husse

Re: Problem after waking up from sleep---help

Post by Husse »

Thanks for that piratesmack
There's some other way to do this as well, to exclude a module from going to sleep -there are several posts in the forum about it also among my posts
I primarily wanted to fix this within the GUI....
Locked

Return to “Beginner Questions”