1. I have three different xorg SeverLayouts: tv-only, lfp-only and tv-lfp;
2. I use SLiM as my login manager, it works fine, and calls "exec /bin/bash -login ~/.xinitrc %session" after a successful login;
3. %session is defined in slim.conf and represents each ServerLayout names (lpf-only -> xfce4, tv-only -> xfce4-tv, tv-lfp -> xfce4-tv-lfp), it is passed as an arg to .xinitrc (SLiM cycles between the possible entries when i hit F1);
4. I cant start xorg with any server layout from the console with "startx -- -layout layout_name", it works like a charm;
5. I want to be able to call each of those ServerLayout with SLiM's %session entries using .xinitrc.
6. I've got to this setup:
DEFAULT_SESSION='startxfce4' case $1 in xfce4) exec <code_here> ;; xfce4-tv) exec <code_here> ;; xfce4-tv-lfp) exec <code_here> ;; *) exec $DEFAULT_SESSION ;; esac
"startxfce4 -- -layout layout_name" and "startx -- -layout layout_name" don't work.
Thanks, that works!
Does that line have the same functionality as starting the session with startxfce4 or will it cripple anything?
That did work great from the console, but SLiM wont run it from .xinitrc.
I've got some info from the log, it's seems whenever i tell SLiM to call anything but startxfce4 this happens and xorg won't startup:
/usr/bin/xauth: creating new authority file /home/npc/.Xauthority xauth: creating new authority file /home/npc/.serverauth.6974 Fatal server error: Server is already active for display 0 If this server is no longer running, remove /tmp/.X0-lock and start again. Couldnt get a file descriptor referring to the console slim: waiting for X server to shut down
That happens with any startx line too.
Found a solution! Partial at least.
I was hacking around the startxfce4 script, and i've found this $SERVERRC variable... hum...
So i tried the following from the console:
SERVERRC="-layout lfp-tv $SERVERRC" startxfce4
And guess what? It works! Xorg sees my other layout and loads it accordingly.
So, the .xinitrc, to allow slim to load xfce4 using one of the layout options passed by the %session variable.
# the following variable defines the session which is started if the user # doesn't explicitely select a session DEFAULT_SESSION='startxfce4' case $1 in xfce4) export SERVERRC="-layout lfp $SERVERRC" ;; xfce4-tv) export SERVERRC="-layout lfp-tv $SERVERRC" ;; xfce4-vga) export SERVERRC="-layout lfp-vga $SERVERRC" ;; *) exec $DEFAULT_SESSION ;; esac exec $DEFAULT_SESSION
And guess what? It DOESN'T work.
Xfce loads fine, but xorg seems not to care about the $SERVERRC variable set on .xinitrc, it only loads the default serverlayout. On a term, echo $SERVERRC returns the exact value set in .xinitrc.
What the heck is going on???
The problem lies on slim, as it has been stated by its devs themselves. Slim fires up a xorg server and passes server arguments on startup, so, after running slim once i cant change such arguments. It's useless to try to change the server layout without restarting xorg as a whole, both server and client, which means quitting slim and manualy starting it from the console.
So it's a missing feature or it's just not possible.