[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Suspend and X



On Wed, Jun 07, 2000 at 09:34:59AM +0200, Hugo van der Merwe wrote:
>> I set replies to go to debian-laptop.
> 
> And you added debian-user to the addresses?

No, I was replying to a message from debian-user. I left both groups
this time since others have.

> 
>> I actually posted one solution to the debian-laptop list this morning. I
>> force the laptop to switch to vt 1 when it suspends. Add the following
>> script to /etc/apm/event.d/01chvt (be sure it's executable):
> 
> How important is that specific filename? I assume it is simply to
> determine in which order the scripts are executed... any specific reason
> why it should be executed early?

I just picked it. On my system I have:

  freedom /etc/apm/event.d $ ls
  00hwclock*  01chvt*  pcmcia*

>> #!/bin/sh
>> # change to vt1 when suspending to keep X from locking
>> 
>> if [ "$1" = suspend ]; then
>>   chvt 1
>> fi

Since I'm usually in X, I added:

if [ "$1" = resume ]; then
  chvt 7
fi

I'd prefer to go back to the same virtual terminal I was on. Is there
a way to query the system for what tty is active? I tried putting
"/usr/bin/tty >/tmp/ttysuspend" into my script, but all I ever see
in the output file is "not a tty". Does it work properly in your case
statement? /usr/bin/tty seems to provide something in /dev if I run it
in an xterm or on the console.

>> 
>> Of course after suspending the system comes back up on vt 1, but I can
>> easily switch back to X if it keeps the system from crashing.
> 
> I still have my case statement in there, to not switch if it is currently
> on tty[1-9]. It seems to work very well if I use "apm -s" as root, but if
> I close the laptop display, it doesn't switch and it locks up... any
> ideas?

No ideas about your problem, here's what happens for me in X:

  apm -s              change to vt 1, suspend to disk
  close on ac power   no effect (bios option)
  close on battery    change to vt1, suspend to disk

Good luck.

-- 
Lee Bradshaw                 lee@sectionIV.com (preferred)
Alantro Communications       lee@alantro.com



Reply to: