You are not logged in.

#1 2009-04-01 14:59:39

Maverick1712
Member
From: Ottawa, Ontario
Registered: 2009-01-08
Posts: 7

Is there a trigger when switching from X to vc and vice versa

Hi all,

Is there a trigger for when switching between vcs or from vc to X and vice versa? The reason I ask is I have to modprobe my mouse each time i go from X->vc->X and I would like this to be automated. I wrote a script for it but typing it in each time, although a minor inconvenience, is something I would like to eliminate if possible.

Cheers,
Adam

Last edited by Maverick1712 (2009-04-01 15:00:03)

Offline

#2 2009-04-01 16:20:49

sirius
Member
From: Norway
Registered: 2008-12-25
Posts: 68

Re: Is there a trigger when switching from X to vc and vice versa

sudo chvt 1

to go to tty1, and then

sudo chvt 7

to go back to X again - if X is running on tty7. (It usually does.)

Offline

#3 2009-04-01 16:49:24

Maverick1712
Member
From: Ottawa, Ontario
Registered: 2009-01-08
Posts: 7

Re: Is there a trigger when switching from X to vc and vice versa

that would take exactly as many keystrokes as running my script then hitting ctrl+alt+fx. I'm looking for a trigger like there is when the machine goes to sleep and such.

Offline

#4 2009-04-01 16:54:42

sirius
Member
From: Norway
Registered: 2008-12-25
Posts: 68

Re: Is there a trigger when switching from X to vc and vice versa

Ahh, sorry, didn't read your post properly. I don't know about any X->vc / vc-> trigger, but maybe you could add a keyboard shortcut to your script?

Offline

#5 2009-04-01 17:06:09

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: Is there a trigger when switching from X to vc and vice versa

considering all vt/s (including 7) are active all the time, i don't think there's an 'event' to note when you switch between them.  personally, depending on your vm i'd script the action like

#!/bin/bash
sudo modprobe mouse
sudo chvt $1

give yourself passwordless sudo rights to those via visudo, then remap Ctrl+Alt+FX to /myscript X.  or add new bindings.

but, there's probably a better way...

Offline

Board footer

Powered by FluxBB