Re: Suspend and X

2000-06-07 Thread Lee Bradshaw
I set replies to go to debian-laptop.

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):

#!/bin/sh
# change to vt1 when suspending to keep X from locking

if [ $1 = suspend ]; then
  chvt 1
fi

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.

Does anyone know how to grab Fn-F1 (Setup Menu) or Fn-F3 (Battery
status) that switch back to text mode? They also crash if you hit
those keys from X, but are fine from a text console.

If you find out how do suspend without switching to a text console
first, please let us know.

On Tue, Jun 06, 2000 at 08:11:24AM +, Mats Rynge wrote:
 Hi!
 
 I'm running potato + kernel 2.2.14 on my laptop, a Dell Inspiron 7000. I
 used to be able to susend the thing without any problems at all, but
 then something happend. I can't recall that I changed anything or that I
 did see any updates on apmd. Now I can only suspend when I am in console
 mode. When I try it under X, the thing just freezes. I can tell that it
 does something right because it shuts down my pcmcia card before
 freezing. I have tried to recompile the kernel with different apm
 options and I have tried to run X with different window managers, but
 nothing helped. I have no clue on what to do now. Any ideas?
 
 TIA
 
 Mats
 
 

-- 
Lee Bradshaw [EMAIL PROTECTED] (preferred)
Alantro Communications   [EMAIL PROTECTED]



Re: Suspend and X

2000-06-07 Thread Hugo van der Merwe
 I set replies to go to debian-laptop.

And you added debian-user to the addresses?

 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?

 #!/bin/sh
 # change to vt1 when suspending to keep X from locking
 
 if [ $1 = suspend ]; then
   chvt 1
 fi
 
 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?

Hugo van der Merwe



Re: Suspend and X

2000-06-07 Thread Alexander Clouter
On Wed, 7 Jun 2000, Lee Bradshaw wrote:

 Does anyone know how to grab Fn-F1 (Setup Menu) or Fn-F3 (Battery
 status) that switch back to text mode? They also crash if you hit
 those keys from X, but are fine from a text console.
 
As far as I know there is no way for any OS to detect the Fn
keypress.  This is because the key is linked to the BIOS.  This can be
shown by running 'showkey'.  by pressing various keys your notice keycodes
being displayed.  However by pressing the Fn button nothing happens.

Well this is all true for my laptop and one or two others I've played
with.

Alex

-- 
**   ((__))  Alexander Jim diGriz Hubenko Clouter
 \\  ((oo))
  \\--\\//  e-mail: [EMAIL PROTECTED]
   ||  || 
   ||||||   
   ~~~~~~  equip : 300Mhz Celeron Laptop running
  Cow during an  Debian Woody Linux
   Earthquake  



Re: Suspend and X

2000-06-07 Thread Lee Bradshaw
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 batterychange to vt1, suspend to disk

Good luck.

-- 
Lee Bradshaw [EMAIL PROTECTED] (preferred)
Alantro Communications   [EMAIL PROTECTED]



Re: Suspend and X

2000-06-07 Thread Saisanthosh Balakrishnan
 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? 
 /usr/bin/tty /tmp/ttysuspend into my script.

/usr/bin/fgconsole  /tmp/ttysuspend

--
saisanthosh



Suspend and X

2000-06-06 Thread Mats Rynge
Hi!

I'm running potato + kernel 2.2.14 on my laptop, a Dell Inspiron 7000. I
used to be able to susend the thing without any problems at all, but
then something happend. I can't recall that I changed anything or that I
did see any updates on apmd. Now I can only suspend when I am in console
mode. When I try it under X, the thing just freezes. I can tell that it
does something right because it shuts down my pcmcia card before
freezing. I have tried to recompile the kernel with different apm
options and I have tried to run X with different window managers, but
nothing helped. I have no clue on what to do now. Any ideas?

TIA

Mats