You are not logged in.

#1 2013-02-12 17:24:17

mindfuckup
Member
From: Switzerland
Registered: 2012-07-04
Posts: 8
Website

[SOLVED] slim does not set a default session

Hi everybody

I think slim does not set the default session (first entry in sessions in /etc/slim.conf):

My /etc/slim.conf:

[...]
login_cmd           exec /bin/bash -login ~/.xinitrc %session
[...]
sessions            openbox
[....]

So the default session (and %session) should be openbox.

My ~/.xinitrc:

DEFAULT_SESSION=openbox

# urxvt -e screen &
(sleep 1;
eval `cat ~/.fehbg`;
conky &
xbindkeys &
volwheel &
pidgin &
) &

case $1 in
awesome|fluxbox|icewm|i3|dwm|wmii|fvwm|twm|wmfs)
  exec ck-launch-session $1
  ;;
openbox)
  /usr/bin/tint2 &
  exec ck-launch-session openbox-session
  ;;
*)
  exec ck-launch-session $DEFAULT_SESSION
  ;;
esac

So. When my sessions option is only "openbox" and .xinitrc is started with $1 = "openbox", it should execute tint2. But it doesn't.

Workaround 1:
When I set openbox directly in login_cmd, it works and tint2 is executed.

login_cmd           exec /bin/bash -login ~/.xinitrc openbox

Workaround 2:
In slim, when I hit F1 to change the session and the words "openbox" appears at the screen, it does also work fine.

That means, that slim does not set the default session correctly. Or am I wrong?

I think this is since the last update.

Thanks for your feedback.

mindfuckup

Last edited by mindfuckup (2013-02-12 19:24:39)

Offline

#2 2013-02-12 17:46:01

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] slim does not set a default session

Slim never set the default session, but there always was a comment in the default config suggesting that it would. This was well known and everybody simply set their own default (I'll get back to this in a second). Instead of simply modifying this comment, Arch included a patch to change Slim's behavior, but this led to new unexpected behavior so it was removed (recently).

You could also have found this in the wiki, which also provides a solution. Another way to fix your .xinitrc is to replace $1 in the case statement by ${1:-openbox}.

Edit: I just noticed you actually had the DEFAULT_SESSION as used in the wiki example. I think the solution in the wiki is a bit strange, and your .xinitrc (where tint2 should only be started for openbox) is an example where the alternative I suggested is simpler. Yet another way is to use the *) case for the default session (so you would not include openbox as a separate case and just start tint2 and openbox unless the $1 is set to awesome).

Last edited by Raynman (2013-02-12 17:52:33)

Offline

#3 2013-02-12 19:03:13

mindfuckup
Member
From: Switzerland
Registered: 2012-07-04
Posts: 8
Website

Re: [SOLVED] slim does not set a default session

Hey Raynman

I didn't know that slim doesn't set the default session. It is still written in in the current /etc/slim.conf on line 50: "(first one is the default)".

Now I understand the problem.

I changed my .xinitrc (same think like ${1:-openbox}):

if [ -z "$1" ]
then
  SESSION="$DEFAULT_SESSION"
else
  SESSION="$1"
[...]
case $SESSION in
[...]
fi

I don't want set the *) case to openbox and tint2, because the other way, I'm more flexible.

Thanks 1k for your tips and explanations!

mindfuckup

Last edited by mindfuckup (2013-02-12 19:03:54)

Offline

#4 2013-02-12 19:06:26

blueblob
Member
Registered: 2011-05-12
Posts: 22

Re: [SOLVED] slim does not set a default session

You could put:

/usr/bin/tint2 &

in your "~/.config/openbox/autostart" file to separate it out and only start it in openbox.

My ~/.xinitrc has just openbox-session instead of using consolekit to launch it

#!/bin/sh

export GTK2_RC_FILES="$HOME/.gtkrc-2.0"

DEFAULT_SESSION=openbox-session
case $1 in
openbox) exec openbox-session ;;
dwm)
    feh --bg-tile .config/wallpapers/assassinsCreed.jpeg
    exec ck-launch-session dwm ;;
*) exec $DEFAULT_SESSION  ;;
esac

and my /etc/slim.conf is nearly identical to yours:

login_cmd exec /bin/bash -login ~/.xinitrc %session
...
sessions default,openbox,dwm

Offline

#5 2013-02-12 19:13:19

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] slim does not set a default session

Offline

Board footer

Powered by FluxBB