Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jan 2001 23:18:40 -0500
From:      The Babbler <bts@babbleon.org>
To:        Sean O'Connell <sean@stat.duke.edu>, freebsd-mobile@freebsd.org, dot@dotat.at
Subject:   Re: switching away from X?
Message-ID:  <3A779220.4E1F1336@babbleon.org>
References:  <3A778B39.EA7D6200@babbleon.org> <20010130225821.B31985@stat.Duke.EDU>

next in thread | previous in thread | raw e-mail | index | archive | help

Thanks for the XFree 4.0 tip, but I've changed my O/S from Linux to
FreeBSD, gotten a new printer, set up a VPN, and about a zillion other
major config changes in the past few weeks, and I really don't think I
can deal with yet another change for a little while.  At least not until
I've recovered from the others.

The zzz code works great, though.  Thanks to you and to Mr. Finch.


Sean O'Connell wrote:
> 
> The Babbler stated:
> :
> : It turns out that I need to do the same thing under FreeBSD that I did
> : under Linux for my Dell i7500; that is, the suspend works fine if I'm at
> : a console but freezes the box if I'm under X.  So I need to switch to a
> : console if X is currently on the display.  (It's fine for X to be
> : *running* as long as it doesn't have the *display*.)
> :
> : Under Linux, this was with the "chvt" but FreeBSD doesn't seem to have
> : one of those.  I've been sporting about it--I've searched
> : www.freebsd.org and the mailing lists archives and altavista and google,
> : and I've come up empty-handed.
> :
> : So how do I switch to a console other than by hitting CTL-ALT-Fn?
> :
> :
> : PS: And since I gotta post anyway, what gets auto-run when I suspend?
> : I notice that the apmd.conf file has SUSPENDREQs go to rc.suspend, so I
> : can just add whatever command there.
> :
> : But the USERSUSPENDREQ doesn't call the file.  But it does do an apm -z
> : at the end; does that really just trigger the SUSPENDREQ event in turn?
> : What is the difference between the two varieties of SUSPENDREQ?
> :
> : Sorry if I'm missing something here.
> 
> Brian-
> 
> If this thing has a Mobility chipset in it, XFree86-4.0.x is your
> friend. It corrects much of this mess; however, there is a program
> floating around called zzz-wrapper written by Tony Finch <dot@dotat.at>
> 
> He posted the contents and instructions to -mobile. I will paste it in
> His comment was:
> 
> "I changed apmd.conf to run my wrapped zzz rather than the standard
> zzz, and my path puts the wrapped zzz first. The code's below."
> 
> /*
>  * zzz.c: a wrapper around apm(8) that works on my dodgy laptop
>  *
>  * (C) 2000 Tony Finch <dot@dotat.at>
>  */
> 
> static const char *const cvsid =
> "$Header: /cvs/fanf/zzz/zzz.c,v 1.1.1.1 2000/06/22 08:43:37 fanf Exp $";
> 
> #include <sys/ioctl.h>
> #include <sys/types.h>
> #include <sys/wait.h>
> 
> #include <machine/console.h>
> 
> #include <unistd.h>
> #include <fcntl.h>
> #include <err.h>
> 
> int main() {
>         int fd, vt, status;
> 
>         fd = open("/dev/vga", O_RDONLY);
>         if(fd < 0) err(1, "open /dev/vga");
>         if(ioctl(fd, VT_GETACTIVE, &vt) < 0)
>                 err(1, "ioctl VT_GETACTIVE");
>         if(ioctl(fd, VT_ACTIVATE, 1) < 0)
>                 err(1, "ioctl VT_ACTIVATE");
>         switch(fork()) {
>         case -1:
>                 err(1, "fork");
>         case 0:
>                 execl("/usr/sbin/apm", "apm", "-z", NULL);
>                 err(1, "exec apm -z");
>         default:
>                 wait(&status);
>                 if(!WIFEXITED(status) || WEXITSTATUS(status))
>                         errx(1, "apm -z failed");
>         }
>         sleep(3);
>         if(ioctl(fd, VT_ACTIVATE, vt) < 0)
>                 err(1, "ioctl VT_ACTIVATE");
>         exit(0);
> }
> 
> --
> 1--------01---------01--------01--------01--------01--------01--------0
> Sean O'Connell                                       sean@stat.Duke.EDU

-- 
"Brian, the man from babble-on"              bts@babbleon.org
Brian T. Schellenberger                      http://www.babbleon.org
Support http://www.eff.org.                  Support decss defendents.
Support http://www.programming-freedom.org.  Boycott amazon.com.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A779220.4E1F1336>