|
Bugzilla – Full Text Bug Listing |
| Summary: | Powersave module should only display settings for available features | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE LINUX 10.0 | Reporter: | Michael Stather <kontakt> |
| Component: | YaST2 | Assignee: | Jiri Srain <jsrain> |
| Status: | RESOLVED FIXED | QA Contact: | Klaus Kämpf <kkaempf> |
| Severity: | Enhancement | ||
| Priority: | P5 - None | CC: | behlert, dkukawka, jsrain |
| Version: | RC 1 | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | All | ||
| Whiteboard: | |||
| Found By: | Other | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
|
Description
Michael Stather
2005-09-14 23:59:28 UTC
Would be nice if this would be possible, but unfortunately you can't say surely if the machine is a laptop or a desktop machine. Yeah but e.g. in Windows if you don´t have a laptop there is no option for closing the laptop in windows, the Hardware manufacturer delivers special "drivers" or configuration files that tell the operating system that this machine is actually a laptop and that it has a Lid / a sleep button etc. On Linux, we have to use what the BIOS provides, which unfortunately often has not much to do with reality :-) Said that, we will try to improve this, we can probably detect a sleep button and a LID switch reliably, so YaST could do better. This is in fact a good idea for an enhancement for one of the next releases, thanks for that. I'll assign the bug over to Jiri who will probably have to implement that and will work with him on this. OK. Stefan, can you guide me how I can detect the availability of Sleep button and Lic close? yes, it is relatively easy:
1) if you want to do it by yourself, you can read from the /proc/acpi/button
directory (warning: this will change in the future as /proc/acpi/* will be
deprecated and moved to sysfs)
A) This is a machine without sleep button:
seife@susi:~> ls -l /proc/acpi/button/
dr-xr-xr-x 3 root root 0 2005-09-27 11:12 lid
dr-xr-xr-x 4 root root 0 2005-09-27 11:12 power
B) This is a machine with sleep button:seife@fix:~> ls -l /proc/acpi/button/
dr-xr-xr-x 3 root root 0 2005-09-27 11:12 lid
dr-xr-xr-x 3 root root 0 2005-09-27 11:12 power
dr-xr-xr-x 3 root root 0 2005-09-27 11:12 sleep
2. using hal, it gets more future-proof:
if hal-find-by-property --key button.type --string lid >/dev/null; then
echo "Lid switch present"
fi
if hal-find-by-property --key button.type --string power >/dev/null; then
echo "power button present"
fi
if hal-find-by-property --key button.type --string sleep >/dev/null; then
echo "sleep button present"
fi
Done in SVN, will submit to STABLE. |