Hey!
Maybe its a really “simple” question. But what is the command to “shutdown” the X windows session??? Right now Im using the combination “Ctrl-Alt-Backspace”. But I guess that’s not the right and best way to do it.
The reason why Im asking this question is that Im not using a desktop environment like Gnome or similar. I’ve installed every peace of my X manually.
Not running Linux on this box, and not switching everything to the other box right now…but I’m about to drop Gnome. Too damn slow. As I recall in my early days of messing with Linux though it’s Halt with some sort of parameter. Do a
No, halt will shut down the entire system, not just X.
Shutting down X is easy, once you grasp how X runs. As soon as the basic X server starts up (grey screen with the X cursor in the middle) it checks the “.xinitrc” file in your home directory for a list of applications to run. Typically, this will be some programs that you want to start every time. These will run in the background (followed by an &). The last item in your .xinitrc should be the window manager. When you quit from the last application listed in .xinitrc, X will also quit and you will be taken back into the console (assuming you started from a console and not a graphical login). It’s that simple. The only reason that quitting the window manager forces X to quit is because it is the last program listed in .xinitrc.
As an example, your .xinitrc might be:
xterm & # Run terminal window in the background
oclock & # Run a clock in the background
xosview & # Run system monitor in the background
mwm # Run Motif window manager in the FOREGROUND
In this case, when you quit mwm, X shuts down. You might have instead:
oclock &
xosview &
mwm &
xterm
In which case shutting down the window manager would not shut down X, it would just leave you with un-window-managed oclock, xosview, and xterm windows. Once you type “exit” in the xterm window, xterm closes which in turn shuts down X, because it was the last thing listed. If the apps listed before it were not followed by an “&”, X would run each of them one after another, only starting an app when the previous one had stopped, until it came to the end of the .xinitrc file.