ACPILID(4) BSD Kernel Interfaces Manual ACPILID(4)NAME
acpilid -- ACPI Lid Switch
SYNOPSIS
acpilid* at acpi?
DESCRIPTION
The acpilid driver supports ACPI ``lid switches''. The powerd(8) daemon can be used to control actions against the events of opening or
closing the lid. The script used is /etc/powerd/scripts/lid_switch, and the events are either pressed (the lid was closed) or released (the
lid was opened).
EXAMPLES
The following example modifies the mentioned script in order to put the system into (S3) sleep when the lid is closed:
...
case "${2}" in
pressed)
logger -p info "${0}: suspending..."
# As in sleep_button, kill some daemons.
#
/etc/rc.d/dhcpcd stop
/etc/rc.d/network stop
/etc/rc.d/wpa_supplicant stop
# Suspend.
#
if /sbin/sysctl hw.acpi.sleep.state >/dev/null 2>&1; then
/sbin/sysctl -w hw.acpi.sleep.state=3
fi
# Waking up.
#
/etc/rc.d/wpa_supplicant start
/etc/rc.d/network start
/etc/rc.d/dhcpcd start
...
SEE ALSO acpi(4), powerd(8), sysmon_pswitch(9)HISTORY
The acpilid driver appeared in NetBSD 1.6.
BSD January 9, 2011 BSD
Check Out this Related Man Page
SYSMON_PSWITCH(9) BSD Kernel Developer's Manual SYSMON_PSWITCH(9)NAME
sysmon_pswitch -- framework for power switches
SYNOPSIS
#include <dev/sysmon/sysmonvar.h>
int
sysmon_pswitch_register(struct sysmon_pswitch *smpsw);
void
sysmon_pswitch_unregister(struct sysmon_pswitch *smpsw);
void
sysmon_pswitch_event(struct sysmon_pswitch *smpsw, int event);
DESCRIPTION
The machine-independent sysmon_pswitch provides a framework for power management. The interface has been largely superceded by the pmf(9)
framework, but sysmon_pswitch is still used to manage power switches as well as related mechanical adapters and buttons. These are encapsu-
lated in the following structure:
struct sysmon_pswitch {
const char *smpsw_name; /* power switch name */
int smpsw_type; /* power switch type */
LIST_ENTRY(sysmon_pswitch) smpsw_list;
};
Unsurprisingly, smpsw_name specifies the name of the power switch and smpsw_type defines the type of it. The following types are defined:
PSWITCH_TYPE_POWER
PSWITCH_TYPE_SLEEP
PSWITCH_TYPE_LID
PSWITCH_TYPE_RESET
PSWITCH_TYPE_ACADAPTER
PSWITCH_TYPE_HOTKEY
If the type is PSWITCH_TYPE_HOTKEY, there are few predefined names that can be used for smpsw_name:
PSWITCH_HK_DISPLAY_CYCLE display-cycle
PSWITCH_HK_LOCK_SCREEN lock-screen
PSWITCH_HK_BATTERY_INFO battery-info
PSWITCH_HK_EJECT_BUTTON eject-button
PSWITCH_HK_ZOOM_BUTTON zoom-button
PSWITCH_HK_VENDOR_BUTTON vendor-button
Once a power switch event has been proceeded, sysmon_pswitch will inform the user space powerd(8), which will possibly execute a script
matching the type of the power switch.
FUNCTIONS
After the sysmon_pswitch structure has been initialized, a new power switch device can be registered by using sysmon_pswitch_register(). The
device can be detached from the framework by sysmon_pswitch_unregister().
The sysmon_pswitch_event() is used to signal a new power switch event. There are two possibilities for the value of event:
PSWITCH_EVENT_PRESSED A button has been pressed, the lid has been closed, the AC adapter is off, etc.
PSWITCH_EVENT_RELEASED A button has been released, the lid is open, the AC adapter is on, etc.
The corresponding events in powerd(8) are pressed and released.
SEE ALSO powerd(8), pmf(9), sysmon_envsys(9), sysmon_taskq(9)AUTHORS
Jason R. Thorpe <thorpej@NetBSD.org>
BSD January 26, 2010 BSD
Hi all,
I have a following code,(linux)
#include<stdio.h>
#include<unistd.h>
int main()
{
printf("start");
sleep(3);
printf("stop");
return 0;
}
i am getting output as
first delay
startstop (5 Replies)
I've noted the following within /var/log/messages, any idea how to check whether they are related to hardware/driver problems, pls?
:confused:
Sep 9 11:56:08 triton smartd: Device: /dev/sda, opened
Sep 9 11:56:08 triton kernel: ACPI: LAPIC (acpi_id lapic_id enabled)
Sep 9 11:56:08... (1 Reply)
I have a script that conducts some SSH calls and I would like to capture the child info so that I can do a sleep and then a cleanup to make sure they do not stay out there as ghosts.
I was told I could do something like this...
#!/bin/sh
for m = job1, job2, job3
x=1... (4 Replies)
please suggest me a way to write c program that takes pattern of the process and returns true or false
my case is i need to keep track of dhcpcd
dhcpcd -d eth1
so i tried popen("ps -ef | grep dhcpcd | grep eth1 | wc -l", "r");
but pipe is storing 1 or 2 when not running
and 2 or 3... (7 Replies)
How would i write a script which will add a following content to a file.
File Before running script.
acpi = 1
apic = 1
builder = 'hvm'
device_model = '/usr/lib/xen/bin/qemu-dm'
disk =
File After running the script.
acpi = 1
apic = 1
builder = 'hvm'
device_model =... (5 Replies)
while sleep 1; do
pgrep Polo || {
kill `pidof Polo` >/dev/null
/var/bin/polo_start.sh start &
echo `date` R >> /var/log/Check_Polo .log
}
done
exit 0well , i use that script as a watchdog in my box (with has just 32 mb memory) which check every second if... (8 Replies)
I have been trying to access bios info regarding temperatures under my Slackware 13.37 OS.
I first looked at /proc/acpi/processor/CPU0/throttling where I found my active state to be T0 and my state count is 16. My understanding is that T0 is 100% throttling of either the CPU fan or the processor... (5 Replies)