vidcontrol, acpi lid and devd

Jochen Keil j.keil at gmx.de
Fri May 7 05:57:04 PDT 2004


Hello List.

Short time ago i've read in an email from this list that it is possible to switch between the terminals with "vidcontrol -sX </dev/console".
This works fine for me.
The next step i took was modifying my /etc/devd.conf:

notify 10 {
        match "system"          "ACPI";
        match "subsystem"       "Lid";
        action                  "/root/lid_switch $notify";
};

In /root/lid_switch i've written the following:

#!/usr/local/bin/bash
case $1 in
0x00)
vidcontrol -s1 </dev/console
;;
0x01)
vidcontrol -s9 </dev/console
;;
esac

So far everything just works great and the console is switched to ttyv1 when the lid switch is pressed.

But while holding the switch down for testing i recognized that the screen turns on after a certain time (around 4-5s).

This doesn't happen when i'm switching the console manually (ctrl-alt-F1).

I presume that the activity of switching to ttyv1 after disabling the display is to blame for turning it on again.

What i'd like to ask:

Is there a way to turn the screen of again by software e.g. sending a "Lid closed" statement to the appropriate device (/dev/acpi)?

It would be very nice if this could be easily implentend into my lid_switch script :)

However, any solution is appreciated.

Feel free to ask me if some facts are unclear or not mentioned.

Regards,

Jochen Keil

P.S. Would be running -current an option?

jochen at chephren ~> uname -a
FreeBSD chephren.lokal.lan 5.2.1-RELEASE-p3 FreeBSD 5.2.1-RELEASE-p3 #3: Mon Mar 29 00:11:42 CEST 2004     jochen at chephren.lokal.lan:/usr/obj/usr/src/sys/CHEPHREN  i386


More information about the freebsd-mobile mailing list