Hiya folks
OK, the basic details first: I have a video card with THREE connectors (DVI, VGA, S-VIDEO), but it will only run any TWO displays at a time.
My main X configuration uses two monitors (DVI & VGA), but I wanted an alternate X configuration I could switch to easily, with output to DVI + SVIDEO, so I could watch movies on the television sometimes.
Rather than do a lot of messing around with multiple xorg.confs, logging-out/in again, or unplugging things, I made two 'ServerLayouts' in my xorg.conf;
Now, by clicking a desktop-link to a one line script like so:
#!/bin/bash
startx -- :1 -layout "television"
A second X session starts using the "television" ServerLayout and displays video on my main monitor, plus the TV. The second monitor turns off. I switch back using CTRL-ALT-F7.
This is cool, and works from my user desktop, but here's the issue(s):
A) Regardless of whether I use a
:1 or
:2 or
:6 or
:<any-number> in the command above, the new session starts on CTRL-ALT-F2 (which is technically TTY2 I guess). What do I have to do to get the new session to start on CTRL-ALT-F6 for example? I'd prefer using F7 & F6 than F7 & F2. Just makes better sense to me.
B) More importantly, I have learned that if I want a similarly clickable (bash) method of switching back to CTRL-ALT-F7 (my default X session) it seems I need to use the
chvt N command. However, as a regular user,
chvt 7 returns a 'Operation Not Permitted' error. As root, it works fine, but I'm not running as root.
The binary
chvt is rwx r-x r-x so I should be able to execute it.
I'm sure there is a VERY simple item I am overlooking, but keep coming back to such things as inittab, init, .bashrc, .bash_profile, and similar files, but it doesn't look like the answer lies in one of these files.
Google mostly gives me the same bash and X tutorials paraphrased 100 different ways, but all they focus on are
CTRL-ALT-Fn (not a mouse click) and
chvt N (works in the tutorials, but not for me).
Guidance is appreciated
Thanks.