Let user select a time of less than 15 mins idle before going to sleep

Bug #1013945 reported by gdi2k
34
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Xfce4 Power Manager
Confirmed
Medium
xfce4-power-manager (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

This is a feature request.

On the AC and Battery screens, there is an option that reads "Put the computer to sleep when inactive for:"

If the slider is set all the way to the left, the setting is "Never".

The first "notch" on the slider is 15 minutes - it is not possible to select a time of less than 15 mins.

For me this is too long - I would like to set it to 10 mins or maybe even less. Would be nice if it started at 5 mins or something like that.

Revision history for this message
In , Troy Sankey (sankeytm) wrote :

Created attachment 4430
change minimum inactivity to 8 minutes

I think the inactivity slider should be a bit more considerate. I suggest 8 minutes instead of 15. 8 may be crazy short for some people, but I think we should give users the freedom to do whatever they want.

I think my patch works, but I haven't tested it.

Revision history for this message
In , Troy Sankey (sankeytm) wrote :

Created attachment 4431
also make appropriate canges to the UI and settings

Perhaps there are more changes to be made than I initially thought. Maybe this should be enough.

Revision history for this message
In , Troy Sankey (sankeytm) wrote :

Created attachment 4432
change minimum inactivity to 8 minutes - version 3

In my second patch I accidentally made inactivity time on battery default to "never" (value set to 7). This changes it back to what it was before (15 minutes).

Revision history for this message
Erik S (ofenfisch) wrote :

The number of minutes to wait til your PC goes sleeping is set in the xfconf-database.

Easily accessable via -> Settings -> settings editor (under "other") -> (on the left side) xfce4-power-manager -> key: "inactivity-on-ac" and "inactivity-on-battery"

I set "...on-ac" to "1" and my laptop goes to sleep after 1 minute ;)

Revision history for this message
Erik S (ofenfisch) wrote :

So, it's just the way how the settings-GUI is showing you this value.

When set to "never" -> the key from xfconf disappears
When set to "#a number#" -> the key represents the minutes to wait until sleeping

If you look in the source (-> http://git.xfce.org/xfce/xfce4-power-manager/tag/?id=xfce4-power-manager-1.2.0), you'll see that a value equal to "14" will set the timeout to "never". Written in the "xfpm-manager.c"-file

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xfce4-power-manager (Ubuntu):
status: New → Confirmed
Changed in xfce4-power-manager:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Federico G. Schwindt (fgsch) wrote :

While I agree with this bug I think "never" should only be displayed when the value is 0.

The application shouldn't try to outsmart the user and restrict the minimum value to some arbitrary number based on someone's preference.

Jackson Doak (noskcaj)
Changed in xfce4-power-manager:
importance: Medium → Wishlist
Changed in xfce4-power-manager (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
In , Harald Judt (hjudt) wrote :

This should be solved in >=1.4 and later (complete rework of this stuff).

Changed in xfce4-power-manager:
importance: Wishlist → Medium
status: Confirmed → Fix Released
Revision history for this message
In , Thaddaeus Tintenfisch (thad-fisch-deactivatedaccount) wrote :

This bug is not fixed (1.4.2). Please re-open this report!

Revision history for this message
In , Harald Judt (hjudt) wrote :

Reopened because it fell victim to my bug cleaning without being fixed.

Changed in xfce4-power-manager:
status: Fix Released → Confirmed
Revision history for this message
In , Steve Dodier-Lazaro (sidi) wrote :

sankeytms: is there any chance that you rebase your patch on the new xfce4-power-manager (git trunk)? It has undergone a rewrite and I'm not sure your patch would still apply.

If you're satisfied that you have a working patch, I will test it for you and nag the developers to have it released.

Thanks.

Revision history for this message
In , Troy Sankey (sankeytm) wrote :

Created attachment 5917
lowers the minimum inactivity duration from 14 to 4 minutes

Here you go. This one even allows down to 5 minutes. I lightly tested it, and it seems to work. For convenience, here are the commands to fetch the relevant properties from the relevant channels (for testing):

  $ xfconf-query --channel xfce4-power-manager -p /xfce4-power-manager/inactivity-on-battery
  $ xfconf-query --channel xfce4-power-manager -p /xfce4-power-manager/inactivity-on-ac

Revision history for this message
In , Troy Sankey (sankeytm) wrote :

Created attachment 5918
inactivity slider now uses exponential scale

This is only slightly related, but it caught my attention because testing the previous patch was awkward. IIRC, OS X (or GNOME 3, I don't quite remember) has some of their inactivity sliders on an exponential scale. This is much more user-friendly IMO. This patch adds that feature to the inactivity sliders, with an exponent of 2.0, giving more fine-tuned control between 4 and 60 minutes.

Revision history for this message
In , Steve Dodier-Lazaro (sidi) wrote :

Hi,

Thanks for the new patches! I tested on ArchLinux 3.18 64Bits and the exponential slider feels *much* better to use. You're on the way to making a very nice contribution :-) A couple of comments below:

- Somehow I cannot go further than 5h40. Is that expected? I would have expected 6 hours (old GUI was 5h50). Could you please round this to 6?

- Keyboard navigation should always increment by at least one. You could make the keyboard event handler move the slider by several increments until it reaches a higher mapped value, though that would be computationally wasteful. Ideally, computed the next mapped slider value that should be used from the existing value in one calculation

- pow is supported on _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L; @Core Developers, Distributors: is there a system for which using pow would be a problem?

- Could you please create a DEFINE for the min and max values in the code? And then, when storing to xfconf, could you please map the min/"Never" value to 0 instead of what it actually is? And when you load 0 from Xfconf, map it to whichever slider value will show "Never" See below for why

- @XFPM Maintainers: Distributors must be warned that they *must* map existing Xfconf keys valued 14 onto a value of 0 or 4 from now on. This is because 14 means "Never" (it's below the minimum which is 15). However, when shortening the min delay to 4, 14 is then read like a normal valid duration.

In an ideal world, you would provide a patch for:
- moving from 14 to a defined value, and handling the storing 0 in xfconf bit
- replacing the existing 15 minutes by 5 minutes (and also to change the values in the .ui for which you can't rely on a define)
- implementing the logarithmic slider with working keyboard navigation

This way if developers want to delay changing the minimum slider value (because of the 14 minute glitch), they can still apply your other changes.

Thanks

Sean Davis (bluesabre)
Changed in xfce4-power-manager (Ubuntu):
status: Confirmed → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.