SLiM Login Manager: No Sessions Nor Shutdown Options

AntumDeluge

Member

Reaction score: 12
Messages: 90

According to SLiM's (x11/slim) configuration file, /usr/local/etc/slim.conf, session options are defined by xdg desktop files located in /usr/local/share/xsessions. I have the following files located in that directory:
Code:
$ ls /usr/local/share/xsessions/
LXDE.desktop     gnome.desktop     openbox.desktop
cinnamon.desktop   openbox-gnome.desktop
cinnamon2d.desktop   openbox-kde.desktop
However, there is no option to select a session in SLiM. Currently it just loads the session by executing the ~/.xinitrc file. Is there a way to get SLiM to recognize the desktop files located in /usr/local/share/xsessions?

Also, there are no shutdown/restart options from the SLiM login screen. Any way to enable these. I noticed that the cursor is not displayed either. I uncommented the option "hidecursor" and set it to "false" in /usr/local/etc/slim.conf but it didn't change anything.

--- Edit ---
Okay, I discovered that I press "F1" to cycle through the session options. And, there are special usernames to restart, shutdown, etc. The slim(1) manpage shows the following options for usernames: console, exit, halt, reboot, suspend.

However, SLiM still does not load sessions correctly. I still have to load sessions from ~/.xinitrc.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,768
Messages: 39,377

Slim loads ~/.xinitrc and passes it an argument. You have to work with that. Using the following in ~/.xinitrc will allow you to choose:
Code:
DEFAULT=i3 # Or whatever WM you want as fallback/default

[ -n $1 ] && exec $1
exec ${DEFAULT}
 
OP
AntumDeluge

AntumDeluge

Member

Reaction score: 12
Messages: 90

Thank you SirDice. That works perfectly. However, is it possible to tell SLiM to default to a specified DE/WM when it starts up. Currently my SLiM configuration is set to "GNOME/Openbox" as the first entry. I would like it to default to either Cinnamon or LXDE instead. Here is my ~/.xinirc:
Code:
#!/bin/sh

DEFAULT=cinnamon-session-cinnamon

[ -n $1 ] && exec $1
exec ${DEFAULT}
This will load the default "Cinnamon" if the the argument is invalid. But I want to SLiM to be set to "Cinnamon" or "LXDE" when it first loads. Currently I have to hit "F1" and cycle through the DEs.

talsamon, here is my /usr/local/etc/slim.conf:
Code:
# Path, X server and arguments (if needed)
# Note: -xauth $authfile is automatically appended
# Use default path from /etc/login.conf
default_path  /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin
default_xserver  /usr/local/bin/X
# The X server needs to be started on an unused virtual terminal,
# for FreeBSD in a default configuration, the first one of those is #09
xserver_arguments  -nolisten tcp vt09

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

# Full path to the xauth binary
xauth_path  /usr/local/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

# Option "sessions" is no longer supported.
# Now you need to put session files in the directory specified
# by option "sessiondir".
# sessions  xfce4,icewm-session,wmaker,blackbox

# Directory of session files.
# They should be xdg-style .desktop files.
# The "Name" entry in the session file would be used as session name.
# The "Exec" entry would replace %session in login_cmd.
sessiondir     /usr/local/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 powering down...
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  fbsd

# Lock file
lockfile  /var/run/slim.pid

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

--- Edit ---
Just found an extended list of SLiM options on the Arch Linux wiki. Going to look through that to see if there is anything to set the default session.

--- Edit ---
Looks like I may need to follow these instructions to set the default session.
 

Anjar Wmk

New Member

Reaction score: 1
Messages: 9

I am facing the same problem. No option for reboot and shutdown for user session

This could be the user didn't have sufficient permission. You could follow this
Thread shutdown-permission-to-user.17829/

this works for me :
# pw group mod operator -m username

Try restarting the session.
 
Top