Difference between revisions of "Talk:Laptop"

From ArchWiki
Jump to: navigation, search
m (Suggestions for saving power)
(Udev Rule to Suspend System)
(15 intermediate revisions by 9 users not shown)
Line 1: Line 1:
== Suggestions for saving power ==
+
==Other tweaks ==
All of these are applied by laptopmode. I added a little note about it, but it's not enough. Some of the values are different from those applied by the default laptopmode config. Redundant/could create issues. [[User:UNIVAC|UNIVAC]] 23:00, 24 September 2009 (EDT)
+
No explanations with these tweaks? What do these do? Is linking to the source enough or should we describe what we're doing in detail? I'm never too comfortable with "do this" type instructions without a "this is why" explanations.--[[User:Multiphrenic|Multiphrenic]] 09:05, 27 April 2011 (EDT)
 +
 
 +
==Udev Rule to Suspend System==
 +
The udev rule could be edited to run a script that does polls the battery's capacity at regular interval when it's status changes to Discharging:
 +
## SLEEP IF BATTERY IS LOW
 +
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", <s>ATTR{capacity}=="2", RUN+="/usr/bin/systemctl suspend</s> RUN+="/script/to/poll/battery/and/suspend/system.sh"
 +
There may also be a uevent that fires when the battery reaches an alarm state (when /sys/class/power_supply/BAT*/alarm is reached or changes).  I have not tested this on my own system yet or figured out just how that file works yet. [[User:Ego.abyssi|Ego.abyssi]] ([[User talk:Ego.abyssi|talk]]) 23:32, 3 March 2013 (UTC)
 +
 
 +
Strange, on my system battery sends "change" uevent each time battery is charged or discharged by 1%, so rule works perfectly and polling is an overcomplication.
 +
--[[User:Eruditorum|Eruditorum]] ([[User talk:Eruditorum|talk]]) 06:48, 30 March 2013 (UTC)

Revision as of 06:49, 30 March 2013

Other tweaks

No explanations with these tweaks? What do these do? Is linking to the source enough or should we describe what we're doing in detail? I'm never too comfortable with "do this" type instructions without a "this is why" explanations.--Multiphrenic 09:05, 27 April 2011 (EDT)

Udev Rule to Suspend System

The udev rule could be edited to run a script that does polls the battery's capacity at regular interval when it's status changes to Discharging:

## SLEEP IF BATTERY IS LOW
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="2", RUN+="/usr/bin/systemctl suspend RUN+="/script/to/poll/battery/and/suspend/system.sh"

There may also be a uevent that fires when the battery reaches an alarm state (when /sys/class/power_supply/BAT*/alarm is reached or changes). I have not tested this on my own system yet or figured out just how that file works yet. Ego.abyssi (talk) 23:32, 3 March 2013 (UTC)

Strange, on my system battery sends "change" uevent each time battery is charged or discharged by 1%, so rule works perfectly and polling is an overcomplication. --Eruditorum (talk) 06:48, 30 March 2013 (UTC)