Thursday, February 16, 2012

X windows Tips & Tools


I normally start my system in text mode (run level 3) and use the GUI when I need a GUI application.  The default for most Linux user (non-server)  installs is to use a GUI session manager (run level 5) which usually provides a means of selecting desktop environments.  [[ You can configure this by editing the file:  /etc/inittab - change between 'id:3:initdefault:' (text mode) and 'id:5:initdefault:' (GUI mode.) ]]  What if you want to start from a virtual console (text based) and then switch/explore the X windows environment(s)?
Here are a few tools and short-cuts for using X Windows under BSD, Linux and probably quite a number of other Unix OS environments.  You may need to install some of these tools. To see if they are already installed use a terminal session and try:
which switchdesk (searches your path for switchdesk)  OR
whereis switchdesk (search for binaries, source and documentation files) OR
locate switchdesk | less (search for ANY matching file and pipe the output a text browser; you may get quite a number of hits with this…)
Under Fedora (and other Linux versions) you can use yum/rpm to install missing tools, i.e.
yum install switchdesk
A) X windows - tool to change display managers, configure X (in your X GUI many options found under: Menu–>System–>Preferences)
  • switchdesk [KDE, GNOME, XFCE, other]  - use this after you install your window manager(s) of choice; you can switch window managers or desktops per session/user or set defaults
  • system-config-display - use this to refine your X configuration
  • system-config-mouse - use this to refine your mouse configuration
  • mouseconfig - ditto
  • kcontrol - use this to adjust KDE configuration
  • gdmsetup - use to configure the Gnome X windows display manager
  • Xorg - network windowing services (See below for keyboard notes)
  • X -configure - setup your system for using X; the tool will attempt to ‘figure out’ a starting point
  • X - config /path/xorg.conf.new - try out an X configuration (note the system default is usually found at /etc/X11/xorg.conf)
  • xsri - use to adjust to ‘root’ image/background (it’s easier to simply change via:  Menu–>System–>Preferences–>Look and Fee–>Backgrounds)
B) X windows - mulitple, virtual X sessions (note ‘:0′ = display 0, ‘:N‘ = display N)
  • text based terminal consoles [1-6] (switch console windows via CTRL+ALT+F[1-6])
  • startx (starts X under default virtual console - CTRL+ALT+F7)
  • startx — :0 vt7 (starts X on virtual console 7 - this is the default - CTRL+ALT+F7)
  • startx — :1 vt8 (starts X on virtual console 8  - CTRL+ALT+F8)
C) X windows - Keyboard Shortcuts (faster than a Mouse!)
  • CTRL+ALT+[left, right] arrow (change workspaces)
  • ALT+TAB (change active window within a workspace)
  • CTRL+ALT+Backspace (Exit the X windows environment - return to graphical login OR to virtual console)
  • CTRL+ALT+Keypad-[Plus, Minus] (cycle through video modes)
  • CTRL+TAB (change active element within a windowed application, i.e. change ‘tabs’ in your browser)
The default number of virtual console text windows for Linux can vary - under Fedora 9 it is 6.  You can switch VC windows and login to each of them.  You can do this EVEN if your system uses a graphical startup (as long as virtual consoles are enabled.)  Try:
1.     boot your Linux box and login via the GUI interface.
2.     press CTRL+ALT+F1, wait a bit, try CTRL+ALT+F2, wait a bit… There may a brief delay as the display switches between graphics and text ‘modes’.  Once you are in ‘text’ mode the simply use ALT+F[1-6] to view the text VCs (note the tty# on the screens); to switch back to graphics mode use ALT+F7, wait a bit.
Combining some of the preceding information try:
1.     login on a virtual console (VC) and, at a command prompt try
2.     switchdesk kde - followed by
3.     startx :5 vt10 - explore KDE (use display device ‘5′, running under VC 10), followed by
4.     CTRL+ALT+Backspace (to leave the X session)
And, for any other X desktop that you have installed, simply supply the option to switchdesk and try them out.  Note that I tested while running Gnome from my VC2 text login; this tied up VC2 and VC7 (the default X VC - which is why the test above use ‘vt10′;  the ‘:5′ could use any number NOT already in use - the default is ‘:0′.
1.     login on a virtual console (VC) and, at a command prompt try
2.     switchdesk xfce - followed by
3.     startx :5 vt10 - explore XFCe4 (running under VC 10), followed by
4.     CTRL+ALT+Backspace (to leave the X session)
1.     login on a virtual console (VC) and, at a command prompt try
2.     switchdesk WindowMaker - followed by
3.     startx :5 vt10 - explore WindowMaker (running under VC 10), followed by
4.     CTRL+ALT+Backspace (to leave the X session)
NOTE - X Windows is resource intensive so you will probably experience delays if you run more than one instance of X on your system; Also, the first time you run a new desktop quite a bit of customization may occur so expect it to be relatively slower than what might be ‘normal’.
A clarification - display identifiers must be unique - you can only have one display per running X session - if you try the steps below you should get an error like:

Fatal server error:
Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.
1.     start x (either login via the GUI or use ’startx’ as indicated above)
2.     within the X session, open a console window
3.     startx :6 vt11 (start another X session under virtual console 11)
If you really want to start a second X session then first change to an un-used text-based virtual console (CTRL+ALT+F[1-6] and use ’startx — :N’ where ‘N’ is not already in use.