! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Doing some useful things before/after turning into "sleep" mode.
Status:
RESOLVED: WONTFIX
Severity:
enhancement
Product:
Xfce4-power-manager
Component:
General

Comments

Description Vladimir 2010-01-26 22:22:03 CET
Hello!
  I have some suggestions (or you may consider them as questions, since we are talking about "feature request", not a "bug report").
  I have posted a mail with these questions to Xfce's mailing list already, but now I'll copy that post here.

  So I just would like to ask what about the following functions:
  - execute some command before/after going into "sleep" mode (this is a
    very important function since there are some kernel modules which need
    to be unloaded before the system turns into "sleep" mode);

  - check for certain running processes before turning into "sleep" mode
    (this function becomes useful when you are downloading something with
    Wget, for example, and willing your laptop to turn into "sleep" mode
    only after download is finished);

  - log all the sleep/suspend/wake events to some log file;

  - making a kind of schedule (of course there is 'shutdown -h hh:mm',
    but still...);

  - maybe producing some sound notification before going to
    "sleep" (strongly optional of course)?

To be honest, I took all these not from my own mind. I had been using KDE3 for a couple of years before switching to Xfce. There are some very convenient and functional applications for KDE3. And KPowersave is one of them. It has all the features I mentioned above. And these features turn to be really useful and even helpful in some cases. For example, my laptop doesn't come back from "sleep" mode if I don't unload some kernel modules before turning it into "sleep" mode.
  
  Also I think it would be nice to have an ability to make custom power management schemes. For example, I need my laptop to turn off its screen after 30 minutes of doing nothing during daytime; and after 1 minute during nighttime. If I had an opportunity to create custom power schemes, I would create two schemes (one for day and one for night) and switch them in the morning and in the evening. It would be just excellent. :)
  
  I hope you can receive my ideas in spite of my poor English. :)

  Thanks for any response and discussion in advance.
  
  Vladimir.
Comment 1 Ali Abdallah editbugs 2010-01-27 10:30:13 CET
(In reply to comment #0)

Thanks for Taking time to report.

> 
>   So I just would like to ask what about the following functions:
>   - execute some command before/after going into "sleep" mode (this is a
>     very important function since there are some kernel modules which need
>     to be unloaded before the system turns into "sleep" mode);

Power Manager runs in user space, it can't execute/shouldn't scripts to unload kernel modules, there is backend implementations for that which is going to be standard, pm-utils, see your distro documentation about it.

> 
>   - check for certain running processes before turning into "sleep" mode
>     (this function becomes useful when you are downloading something with
>     Wget, for example, and willing your laptop to turn into "sleep" mode
>     only after download is finished);

The implementation should be the other way round, the applications which to prevent automatic sleep, should tells the power manager to inhibit automatic sleep, it is already implemented, some application does inhibit the power manager while doing some activities.

But to be honest this is not widely deployed, a discussion ongoing to make this implementation standard.

>   - log all the sleep/suspend/wake events to some log file;


Kernel work.

>   - making a kind of schedule (of course there is 'shutdown -h hh:mm',
>     but still...);

Well, maybe

>   - maybe producing some sound notification before going to
>     "sleep" (strongly optional of course)?

Could be a cool feature.

> To be honest, I took all these not from my own mind. I had been using KDE3 for
> a couple of years before switching to Xfce. There are some very convenient and
> functional applications for KDE3. And KPowersave is one of them. It has all the
> features I mentioned above. And these features turn to be really useful and
> even helpful in some cases. For example, my laptop doesn't come back from
> "sleep" mode if I don't unload some kernel modules before turning it into
> "sleep" mode.


You are welcome to Xfce, of course i will be happy to implement features that can be used in user mode.

> 
>   Also I think it would be nice to have an ability to make custom power
> management schemes. For example, I need my laptop to turn off its screen after
> 30 minutes of doing nothing during daytime; and after 1 minute during
> nighttime. If I had an opportunity to create custom power schemes, I would
> create two schemes (one for day and one for night) and switch them in the
> morning and in the evening. It would be just excellent. :)


Good idea, will keep you notified about the progress, not sure when this is going to happen since we have many troubles now going concerning deprecation of HAL, so the focus it to keep the power manager compatible with whatever backend will be used at the end.
Comment 2 Vladimir 2010-02-05 08:26:38 CET
(In reply to comment #1)
> 
> Power Manager runs in user space, it can't execute/shouldn't scripts to unload
> kernel modules, there is backend implementations for that which is going to be
> standard, pm-utils, see your distro documentation about it.
>
  Hmm. I used to run something like 'sudo modprobe -r rt73usb' before going to "sleep" mode (while using KPowersave on KDE3). It worked fine, but if you say I should better figure out how to work with pm-utils, of course, I'll try to do that.

> The implementation should be the other way round, the applications which to
> prevent automatic sleep, should tells the power manager to inhibit automatic
> sleep, it is already implemented, some application does inhibit the power
> manager while doing some activities.
> 
> But to be honest this is not widely deployed, a discussion ongoing to make this
> implementation standard.
> 
  I believe there are different cases. For example, somebody wants his system turn off (or go into "sleep" mode) in spite of the running program (like a music player or a movie player), but other people may be willing their system not tu turn off while the same program is running. 
  I'll give an example:
  I use GGL (that's Gentoo GNU/Linux). You probably know that every program is compiled on the user's machine in GGL. (there could be some exceptions, but still...) That is why very often I leave my machine turned on for night to install some new programs (or to install new versions of existing programs). It would be very very nice if Power Manager turned my computer into "sleep" mode when all the programs are installed. And this means that Power Manager should check whether "cc1plus", "cc1", "ebuild.sh", etc. are still running before deciding to switch the power state.
  So, all I'm trying to say is that there probably are such programs which must not block the transition to low power consumption states by themselves, because not every user wants that. Still, there are such cases in which user would want it to happen.
Comment 3 Ali Abdallah editbugs 2011-09-09 10:53:26 CEST
This is more on the pmutils part...

Bug #6184

Reported by:
Vladimir
Reported on: 2010-01-26
Last modified on: 2011-09-09

People

Assignee:
Ali Abdallah
CC List:
0 users

Version

Version:
0.8.4.2

Attachments

Additional information