1 |
Steve Herber <herber@×××××.com> posted |
2 |
Pine.LNX.4.64.0906170910450.29525@×××××.com, excerpted below, on Wed, 17 |
3 |
Jun 2009 09:39:13 -0700: |
4 |
|
5 |
> Can somebody answer a question, related to the favorite WM question, how |
6 |
> do I change to an alternative window manager? |
7 |
> |
8 |
> I normally run xdm and update my .xinitrc or .xsession file to do this |
9 |
> but I feel that there should be a better way. How do you do it? |
10 |
|
11 |
My "better way" is to not use a graphical login manager at all, but |
12 |
rather to login at the text login prompt, and start X (and my WM/DE |
13 |
(windo manager / desktop environment) of choice) from there. Whether |
14 |
that's a "better way" for you or not, of course depends on you, but it |
15 |
Works for Me (tm)! |
16 |
|
17 |
The various DEs and at least some of the WMs should put session scripts |
18 |
in /etc/X11/Sessions, with launchers (like startkde) in the path. You |
19 |
can either use the launchers, or create your own. |
20 |
|
21 |
I create my own launchers as scriptlets that make use of the generic |
22 |
startx. Normally, startx depends on the XSESSION variable as set and |
23 |
exported in either the system scripts (rc.conf, IIRC for baselayout-1 |
24 |
users) or in a user's startup scripts (.bashrc or the like). However, |
25 |
that's kind of limiting since it leaves just one choice. So for each |
26 |
session script in /etc/X11/Sessions, I create a scriptlet, say k4 for |
27 |
kde4, k3 for kde3, g2 if I had gnome2 installed, etc. Each of these sets |
28 |
and exports the XSESSION variable to match the appropriate filename in |
29 |
the Sessions dir, and then invokes startx. Now, with a single short (two- |
30 |
character in the above examples, g2, k3, k4, etc) command, I can start |
31 |
any of the session types I want. =:^) |
32 |
|
33 |
What's nice about this is that once the launcher scriptlets are setup, |
34 |
it's possible to take care of any other housekeeping as necessary, |
35 |
setting up any other environmental vars, whatever. Any commands before |
36 |
the startx will run as X and that environment starts. Any after it will |
37 |
run as it quits back to the text login. Or, make it startx &, so it runs |
38 |
in the background and issue the bash disown command, and the script will |
39 |
startx in the background and then terminate, leaving you with a bash |
40 |
prompt again. Then you can do what I do and run ". k3", so it runs it in |
41 |
the current shell, and it'll logout after startx as well, thus returning |
42 |
that VT to the login prompt. |
43 |
|
44 |
As can be seen, it wasn't for nothing that I said my system is rather |
45 |
more uniquely customized than most. =:^) But it fits the way I work and |
46 |
is thus the "better way" for me, which is what counts. And of course |
47 |
Gentoo makes all that customization far easier than most distributions |
48 |
do, making it all the better! =:^) |
49 |
|
50 |
-- |
51 |
Duncan - List replies preferred. No HTML msgs. |
52 |
"Every nonfree program has a lord, a master -- |
53 |
and if you use the program, he is your master." Richard Stallman |