Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SLiM doesn't start my .xsession
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
riaqn
n00b
n00b


Joined: 06 Aug 2013
Posts: 3

PostPosted: Tue Aug 06, 2013 11:50 am    Post subject: SLiM doesn't start my .xsession Reply with quote

(Sorry for poor English :D )
I 've installed SLiM and I want to use it to start awesome.I followed http://wiki.gentoo.org/wiki/SLiM#Per-user_default_session_using_bundled_session_files
Code:
senge@Senge-Laptop ~ $ ls -l ~/.xsession
lrwxrwxrwx 1 senge senge 25 Aug  6 16:02 /home/senge/.xsession -> /etc/X11/Sessions/awesome

All other config files is default(I guess :D )

But after I successfully login, awesome was not up.It just give me a xterm window, no more.

It seems that slim execute xterm as a fallback.slim cannot find my session file.If I run awesome in the xterm window, the WM can start up.So I think It just because slim cannot find my session, not related to awesome.

I 've tried add consolekit support to slim, not work.
Back to top
View user's profile Send private message
riaqn
n00b
n00b


Joined: 06 Aug 2013
Posts: 3

PostPosted: Wed Aug 07, 2013 1:09 am    Post subject: Reply with quote

I look through /usr/share/slim/Xsession, something strange.
Code:
if [ "x$command" = "x" ]; then
  # no default specified, check if Xsession will complete
  # and if not then assign XSESSION to command
  if [ -x "$HOME/.xsession" ] || [ -x "$HOME/.Xclients" ] || [ -x /etc/X11/xinit/Xclients ] || [ -x /etc/X11/Xclients ]; then
    command="Xsession"
  else
    command=$XSESSION
  fi
fi

If slim found .xsession, should it execute the session? what does "Xsession" mean?

FULL /usr/share/slim/Xsession
Code:
#!/bin/sh
#
# Slim login manager Xsession script
#

command="$@"
# this will go into slim.log along with all other echo's
# good for debugging where things go wrong
echo "$0: Beginning session setup..."

# First read /etc/profile and .profile
test -f /etc/profile && . /etc/profile
test -f "$HOME/.profile" && . "$HOME/.profile"
# Second read /etc/xprofile and .xprofile for X specific setup
test -f /etc/xprofile && . /etc/xprofile
test -f "$HOME/.xprofile" && . "$HOME/.xprofile"

# wrap possible arguments to determine whether to treat special or not
if [ "x$command" = "xcustom" ] || [ "x$command" = "xCustom" ] || [ "x$command" = "xdefault" ] || [ "x$command" = "xDefault" ]; then
  command="Xsession"
fi
if [ "x$command" = "x" ]; then
  # no default specified, check if Xsession will complete
  # and if not then assign XSESSION to command
  if [ -x "$HOME/.xsession" ] || [ -x "$HOME/.Xclients" ] || [ -x /etc/X11/xinit/Xclients ] || [ -x /etc/X11/Xclients ]; then
    command="Xsession"
  else
    command=$XSESSION
  fi
fi

# most of this is from /etc/X11/chooser.sh
sessionscript=""
if [ -n "${command}" ]; then
  # find a match for $command in /etc/X11/Sessions
  for x in /etc/X11/Sessions/* ; do
    if [ "`echo ${x##*/} | awk '{ print toupper($1) }'`" = "`echo ${command} | awk '{ print toupper($1) }'`" ]; then
      sessionscript=${x}
      break
    fi
  done
  if [ -n "${sessionscript}" ]; then
    if [ -x "${sessionscript}" ]; then
      command="${sessionscript}"
    else
      command="/bin/sh ${sessionscript}"
    fi
  else

    # find an executable for $command
    x=""
    y=""

    for x in "${command}" "`echo ${command} | awk '{ print toupper($1) }'`" "`echo ${command} | awk '{ print tolower($1) }'`"
    do
   echo $x
      # Fall through ...
      if [ -x "`which ${x} 2>/dev/null`" ]; then
   y="`which ${x} 2>/dev/null`"
   break
      fi
    done
    # note , if the command could not be found then $command will be empty
    command="$y"
    unset x
    unset y
  fi
fi

# call xrdb and xmodmap and such, since $command is not a session script
if [ -z "${sessionscript}" ]; then
  userresources="$HOME/.Xresources"
  usermodmap="$HOME/.Xmodmap"
  userxkbmap="$HOME/.Xkbmap"

  sysresources=/etc/X11/Xresources
  sysmodmap=/etc/X11/Xmodmap
  sysxkbmap=/etc/X11/Xkbmap

  rh6sysresources=/etc/X11/xinit/Xresources
  rh6sysmodmap=/etc/X11/xinit/Xmodmap

  # merge in defaults
  if [ -f "$rh6sysresources" ]; then
    xrdb -merge "$rh6sysresources"
  fi

  if [ -f "$sysresources" ]; then
    xrdb -merge "$sysresources"
  fi

  if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
  fi

  # merge in keymaps
  if [ -f "$sysxkbmap" ]; then
    setxkbmap `cat "$sysxkbmap"`
    XKB_IN_USE=yes
  fi

  if [ -f "$userxkbmap" ]; then
    setxkbmap `cat "$userxkbmap"`
    XKB_IN_USE=yes
  fi

  #
  # Eeek, this seems like too much magic here
  #
  if [ -z "$XKB_IN_USE" -a ! -L /etc/X11/X ]; then
    if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f /etc/X11/XF86Config ]; then
      xkbsymbols=`sed -n -e 's/^[     ]*XkbSymbols[   ]*"\(.*\)".*$/\1/p' /etc/X11/XF86Config`
      if [ -n "$xkbsymbols" ]; then
        setxkbmap -symbols "$xkbsymbols"
        XKB_IN_USE=yes
      fi
    fi
  fi

  # xkb and xmodmap don't play nice together
  if [ -z "$XKB_IN_USE" ]; then
    if [ -f "$rh6sysmodmap" ]; then
      xmodmap "$rh6sysmodmap"
    fi

    if [ -f "$sysmodmap" ]; then
      xmodmap "$sysmodmap"
    fi

    if [ -f "$usermodmap" ]; then
      xmodmap "$usermodmap"
    fi
  fi

  unset XKB_IN_USE
fi
unset sessionscript

# start failsafe session
if [ -z "${command}" ]; then
  echo "$0: Failed to find a command to start the session, so starting a failsafe xterm."
  exec xterm -geometry 80x24+0+0
fi

# run all system xinitrc shell scripts which will update command
if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for i in /etc/X11/xinit/xinitrc.d/* ; do
    if [ -x "$i" ]; then
      . "$i"
    fi
  done
  unset i
fi

echo "$0: Setup done, will execute: $command"
exec $command

# vim:ts=4
Back to top
View user's profile Send private message
CleanTestr
n00b
n00b


Joined: 15 Jan 2013
Posts: 47
Location: somewhere in Rural Nebraska, USA

PostPosted: Wed Aug 21, 2013 6:46 am    Post subject: Reply with quote

To help us better resolve your problem, please post your:

cat ~/.xinitrc
cat /etc/slim.conf
rc-update show

If possible, use wgetpaste ('emerge wgetpaste').
_________________
Stan: A signal? Why didn't you wake me?
790: It was a distress signal. They only lead to trouble, so I always ignore them. --Lexx
Back to top
View user's profile Send private message
riaqn
n00b
n00b


Joined: 06 Aug 2013
Posts: 3

PostPosted: Wed Aug 21, 2013 8:05 am    Post subject: Reply with quote

CleanTestr wrote:
To help us better resolve your problem, please post your:

cat ~/.xinitrc
cat /etc/slim.conf
rc-update show

If possible, use wgetpaste ('emerge wgetpaste').

Thanks for reply!
I solve this problem by using ~/.xinitrc instead of ~/.xsession. Configuration has changed. But I am curious about the reason why I failed to start xsession. So I am trying to show situation several weeks ago.

First, There is no ~.xinitrc.

slim.conf
Code:
# 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 -br -deferglyphs 16 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             off

# 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
login_cmd           exec /bin/bash -login /usr/share/slim/Xsession %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
sessionstart_cmd   /usr/bin/sessreg -a -l :0.0 %user
sessionstop_cmd     /usr/bin/sessreg -d -l :0.0 %user

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

# Available sessions:
# The current chosen session name replaces %session in the login_cmd
# above, so your login command can handle different sessions.
# If no session is chosen (via F1), %session will be an empty string.
# see the xinitrc.sample file shipped with slim sources
#sessions            xfce4,icewm-session,wmaker,blackbox
# Alternatively, read available sessions from a directory:
sessiondir           /etc/X11/Sessions

# Executed when pressing F11 (requires media-gfx/imagemagick for import)
# Alternative is media-gfx/scrot. See Gentoo bug 252241 for more info.
screenshot_cmd      import -window root /slim.png
#screenshot_cmd      scrot /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       custom

# Lock file, /etc/init.d/xdm expects slim.pid
lockfile            /var/run/slim.pid

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

rc-update show
Code:
                acpid | boot                         
            alsasound | boot                         
             bootmisc | boot                         
                devfs |                       sysinit
                dmesg |                       sysinit
                 fsck | boot                         
              goagent |      default                 
             hostname | boot                         
              hwclock | boot                         
              keymaps | boot                         
            killprocs |              shutdown       
                local |      default                 
           localmount | boot                         
              modules | boot                         
             mount-ro |              shutdown       
                 mtab | boot                         
               net.lo | boot                         
            net.wlan0 | boot                         
             nfsmount |      default                 
               procfs | boot                         
                redis |      default                 
                 root | boot                         
            savecache |              shutdown       
                 swap | boot                         
            swapfiles | boot                         
               sysctl | boot                         
                sysfs |                       sysinit
         termencoding | boot                         
       tmpfiles.setup | boot                         
                 udev |                       sysinit
           udev-mount |                       sysinit
              urandom | boot                         
                  xdm |      default                 

Back to top
View user's profile Send private message
CleanTestr
n00b
n00b


Joined: 15 Jan 2013
Posts: 47
Location: somewhere in Rural Nebraska, USA

PostPosted: Thu Aug 22, 2013 12:41 am    Post subject: Reply with quote

Sorry, I only know a method using .xinitrc. Perhaps someone else can help.
_________________
Stan: A signal? Why didn't you wake me?
790: It was a distress signal. They only lead to trouble, so I always ignore them. --Lexx
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum