[Pcbsd-developer] Re: Detecting if computer is laptop or desktop
Status: Beta
Brought to you by:
kmoore134
From: Federico L. <flo...@gm...> - 2006-04-02 17:30:50
|
Well, my laptop's (which i managed to ressurect) cpu line on dmesg is the EXACT same as my P3 server, so i dont think that that would work, however most modern laptops have a lid... so here is a little script which should detect laptop / desktop: #!/bin/sh # Laptop detection script V0.001 # Reply to the mailing list if it doesn't work... dmesgLine=3D`dmesg | grep "acpi_lid0: <Control Method Lid Switch> on acpi0"= ` if test "${dmesgLine}" =3D ""; then echo "You have a desktop!" else echo "You have a laptop!" fi Cheers On 4/1/06, mai...@gm... <mai...@gm...> wrot= e: > Some laptops (such as the one I'm using right now), have a numpad install= ed. > I would recommend an installer option that asks the user whether or not i= t's > got a numpad. > > > > It's probably also not feasible to look at the CPU name both because ther= e > are a lot of cpu types out there, and I doubt you're going to find a nice > list of every one possibly available, and because there are some crazy fo= lk > out there who put a mobile chip in a desktop (for overclocking), or a nor= mal > chip in a laptop. > > -Matt McDonald > > > > _____ > > From: pcb...@li... > [mailto:pcb...@li...] On Behalf Of Charles= A. > Landemaine > Sent: Saturday, April 01, 2006 6:27 AM > To: pcb...@li... > Subject: [Pcbsd-developer] Detecting if computer is laptop or desktop > > > > Hello guys :) > > > > Is it possible to detect if the user's computer is a laptop or desktop? > Renato suggested looking at the CPU name and decide accordingly. Is it 10= 0% > sure to work? > > Is there another way? > > If not, I suggested to add a "Select between laptop or desktop" option > during installation to turn on/off the numlock key accordingly. > > Discussion here: http://www.pcbsd.org/forums/viewtopic.php?t=3D2402 > > Have a nice week-end! :) > > -- > Charles A. Landemaine. > > > |