Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Aug 2000 19:46:08 -0500 (EST)
From:      Jonathan Smith <jonsmith@dragonstar.dhs.org>
To:        Tony Finch <dot@dotat.at>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: apm and X
Message-ID:  <Pine.BSF.4.21.0008301945230.2768-100000@dragonstar.dhs.org>
In-Reply-To: <20000831004331.B25064@hand.dotat.at>

next in thread | previous in thread | raw e-mail | index | archive | help
zzz suspends and resumes just fine; the ONLY problem I have is hitting
dpms up to kill the X windows display to the vid card.

j.


--
Close your eyes.  Now forget what you see.  What do you feel? --
My heart. --  Come here. --  Your heart. --  See?  We're exactly the same.

	Jon Smith -- Senior Math Major @ Purdue

On Thu, 31 Aug 2000, Tony Finch wrote:

> Jonathan Smith <jonsmith@dragonstar.dhs.org> wrote:
> >I'm running X 4 on 4.1-RELEASE and apm -z blanks the screen and puts the
> >machine to sleep happily, but when done from within X, the X descktop
> >stays on screen and the monitor doesn't blank out.
> 
> Can you recover from this situation? My laptop hangs *hard* when I try
> to suspend from within X, so I wrote a small wrapper to switch to a
> text console before running `apm -z` which I keep in /usr/local/bin.
> You should also change /etc/apmd.conf to invoke this zzz rather than
> the standard one.
> 
> Tony.
> -- 
> en oeccget g mtcaa    f.a.n.finch
> v spdlkishrhtewe y    dot@dotat.at
> eatp o v eiti i d.    fanf@covalent.net
> 
> 
> /*
>  * 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);
> }
> 



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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0008301945230.2768-100000>