You are not logged in.

#1 2014-01-20 23:27:59

josealb77
Member
Registered: 2013-06-23
Posts: 90

[SOLVED] How to change between sessions in SLIM?

Hi,
when I get to the SLIM login screen I hit F1 and the "session: XXXX" white words change between my installed desktops, but whatever session I choose it always log me in MATE (my default session). In order to login to any other I have to change my xintirc file manually.
Here it's my ~/.xinitrc file:

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

#if [ -d /etc/X11/xinit/xinitrc.d ]; then
#  for f in /etc/X11/xinit/xinitrc.d/*; do
#    [ -x "$f" ] && . "$f"
#  done
#  unset f
#fi

# exec gnome-session
# exec startkde
# exec startxfce4
# exec mate-session
# ...or the Window Manager of your choice

case $1 in
openbox)
	exec ck-launch-session enlightenment_start openbox-session
	;;
mate|*)
	exec mate-session
	;;
esac

xrdb -merge ~/.Xresources

And my /etc/slim.conf file:

# Path, X server and arguments (if needed)
# Note: -xauth $authfile is automatically appended
default_path        /bin:/usr/bin:/usr/local/bin
default_xserver     /usr/bin/X
xserver_arguments -nolisten tcp vt07

# Commands for halt, login, etc.
halt_cmd            /sbin/shutdown -h now
reboot_cmd          /sbin/shutdown -r now
console_cmd         /usr/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/issue; exec /bin/login"
#suspend_cmd        /usr/sbin/suspend

# Full path to the xauth binary
xauth_path         /usr/bin/xauth 

# Xauth file for server
authfile           /var/run/slim.auth


# Activate numlock when slim starts. Valid values: on|off
numlock             on

# Hide the mouse cursor (note: does not work with some WMs).
# Valid values: true|false
# hidecursor          false

# This command is executed after a succesful login.
# you can place the %session and %theme variables
# to handle launching of specific commands in .xinitrc
# depending of chosen session and slim theme
#
# NOTE: if your system does not have bash you need
# to adjust the command according to your preferred shell,
# i.e. for freebsd use:
# login_cmd           exec /bin/sh - ~/.xinitrc %session
login_cmd           exec /bin/bash -login ~/.xinitrc %session

# Commands executed when starting and exiting a session.
# They can be used for registering a X11 session with
# sessreg. You can use the %user variable
#
# sessionstart_cmd	some command
# sessionstop_cmd	some command

# Start in daemon mode. Valid values: yes | no
# Note that this can be overriden by the command line
# options "-d" and "-nodaemon"
# daemon	yes

# Set directory that contains the xsessions.
# slim reads xsesion from this directory, and be able to select.
sessiondir            /usr/share/xsessions/

# Executed when pressing F11 (requires imagemagick)
screenshot_cmd      import -window root /slim.png

# welcome message. Available variables: %host, %domain
welcome_msg         Welcome to %host

# Session message. Prepended to the session name when pressing F1
# session_msg         Session: 

# shutdown / reboot messages
shutdown_msg       The system is halting...
reboot_msg         The system is rebooting...

# default user, leave blank or remove this line
# for avoid pre-loading the username.
#default_user        simone

# Focus the password field on start when default_user is set
# Set to "yes" to enable this feature
#focus_password      no

# Automatically login the default user (without entering
# the password. Set to "yes" to enable this feature
#auto_login          no

# current theme, use comma separated list to specify a set to 
# randomly choose from
#current_theme       default
#current_theme       archlinux,wave,scotland-road,rear-window,rainbow,pararell-dimensions,mindlock,lunar,lotus-midnight,lake,flower2,archlinux-darch-white
current_theme		archlinux-darch-white

# Lock file
lockfile            /var/lock/slim.lock

# Log file
logfile             /var/log/slim.log

Last edited by josealb77 (2014-01-21 13:57:48)

Offline

#2 2014-01-20 23:58:34

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] How to change between sessions in SLIM?

Offline

#3 2014-01-21 01:39:56

josealb77
Member
Registered: 2013-06-23
Posts: 90

Re: [SOLVED] How to change between sessions in SLIM?

I've read that and a lot of more sites, and tried lots of things but whitout any change. I think that particular page does not clarify much.
So, can someone who actually is able to change between window managers using SLIM post his/her ~/.xinitrc? or at least his/her ~/.xinitrc multi window manager part?

Offline

#4 2014-01-21 01:44:38

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] How to change between sessions in SLIM?

Well... considering that your xinitrc doesn't follow what is instructed in that section I linked, maybe you should reread it.

Offline

#5 2014-01-21 12:21:39

josealb77
Member
Registered: 2013-06-23
Posts: 90

Re: [SOLVED] How to change between sessions in SLIM?

Now I've changed it to a "cleaner version" (something I already did some time before) in order to be easier for people to help me:

case $1 in
enlightenment)
    exec enlightenment_start
    ;;
openbox)
    exec openbox-session
    ;;
mate|*)
	exec mate-session
esac

Nevertheless slim is still always login me in MATE. What's wrong?

Offline

#6 2014-01-21 12:36:07

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,737
Website

Re: [SOLVED] How to change between sessions in SLIM?

You're still not reading the wiki page. If you want to use the depreciated case..esac block for some reason, you'll need to modify your matches. At the moment everything will be caught by the catchall, as you're not matching any sessions (as far as I can tell).


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#7 2014-01-21 13:57:26

josealb77
Member
Registered: 2013-06-23
Posts: 90

Re: [SOLVED] How to change between sessions in SLIM?

WorMzy wrote:

You're still not reading the wiki page. If you want to use the depreciated case..esac block for some reason, you'll need to modify your matches. At the moment everything will be caught by the catchall, as you're not matching any sessions (as far as I can tell).

Thaaaaaat's it. That was my understanding. I thought that the deprecated mode was:

 DEFAULTSESSION=openbox-session

case "$1" in
    openbox) exec openbox-session ;;
     xfce) exec xfce4-session ;;
     gnome3) exec gnome-session ;;
     kde) exec startkde ;;
     cinnamon) exec gnome-session-cinnamon ;;
     razor-qt) exec razor-session ;;
     lxde) exec lxsession ;;
     mate) exec mate-session ;;
     *) exec $DEFAULTSESSION ;;
esac

And the new mode was line by line and without the DEFAULTSESSION "command":

case $1 in
enlightenment)
    exec enlightenment_start
    ;;
openbox)
    exec openbox-session
    ;;
mate|*)
	exec mate-session
esac

Since I didn't see any window manager using the new way, I didn't realise that the new mode is replacing all the case..esac block for just:

exec $1

Less intuitive but much cleaner.
Thanks to the WorMzy comment I have found the key. Thank you WonderWoofy for trying to help too.

Offline

#8 2014-01-21 15:17:14

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] How to change between sessions in SLIM?

Do you realize that those two variations of the case/esac block above are the same thing with different spacing?  The difference between the two is really just a preference in how you would like your script to look.

Offline

#9 2014-01-21 15:44:41

josealb77
Member
Registered: 2013-06-23
Posts: 90

Re: [SOLVED] How to change between sessions in SLIM?

Yes I realise, but since I don't know programming I wasn't sure if it could change something, and just writting "esec $1" was so minimalistic for me, I thought that I wasn't understanding it well.
I've got more doubts about being able to login with another window manager in tty8, tt9, tt10, 11 and 12, that I think it's adding vt08, vt09, and so on in some configuration file. Doubts about changing the default session with this new metod. And doubts about a some kind or failure phrase that appeared after login in enlightenment with SLIM, but I will spend more time in it the next weeks, I'm busy at the moment.

See you!

Offline

Board footer

Powered by FluxBB