You are not logged in.
Hi all
I am looking for a command application, which allows me to switch between running X Servers. Similar to ctrl+alt+Fx. I do need this, because I need the source how this is done.
THX
Last edited by ying (2011-08-30 20:36:31)
Offline
There is a virtual keyboard application called xdotool
For example,
xdotool key ctrl+alt+F1
Thou shalt not make a machine in the likeness of a human mind
Offline
You can use "chvt" commnd. For example, command:
chvt 4
will switch to console 4
If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau
Registered Linux User: #559057
Offline
You can use "chvt" commnd. For example, command:
chvt 4
will switch to console 4
Not exactly, I get
[karol@black ~]$ chvt 4
chvt: VT_ACTIVATE: Operation not permitted
when running inside X. OP wants to switch between running X servers, not VTs.
Offline
Shark wrote:You can use "chvt" commnd. For example, command:
chvt 4
will switch to console 4
Not exactly, I get
[karol@black ~]$ chvt 4 chvt: VT_ACTIVATE: Operation not permitted
when running inside X. OP wants to switch between running X servers, not VTs.
If you are inside X, then you have to do:
sudo chvt 4
Running X servers can be switched via chvt. For me to change from display 0 to display 1 i just do "chvt 8" as root.
Last edited by Shark (2011-08-30 14:14:54)
If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau
Registered Linux User: #559057
Offline
If you are inside X, then you have to do:
sudo chvt 4
Running X servers can be switched via chvt. For me to change from display 0 to display 1 i just do "chvt 8" as root.
D'oh. Thanks for this explanation.
Offline
In X, when you press Ctrl+Alt+F1...F12, you are switching VTs. In the xorg-server source xorg-server-1.11.0/hw/xfree86/common/xf86Events.c, you can see the function called for switching VT is xf86VTActivate(), which is defined in the files xorg-server-1.11.0/hw/xfree86/os-support/*/*VTsw*. The actual code is something like:
ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno)
Compare this to the chvt code:
ioctl(fd,VT_ACTIVATE,num)
You see how it's done
This silver ladybug at line 28...
Offline
Hey thanks to all of you!
@lolilolicon: Perfect!
*Solved*
Edit: Is there also a way, to read out all running X servers and get the display and vt of it?
Last edited by ying (2011-08-30 20:37:28)
Offline