slim的脚本,到底怎么写才好捏?

其他Linux/Unix/BSD/OSX等发行版讨论
回复
头像
adagio
论坛版主
帖子: 22110
注册时间: 2008-02-17 23:47
来自: 美丽富饶的那啥星球

slim的脚本,到底怎么写才好捏?

#1

帖子 adagio » 2010-08-29 12:25

我用源里的slim,现在是 1.3.2-1,可是一直存在一个烂问题,就是虽然设定为自动登录了,但是每次开机都显示 “fails login commande”,然后就退回登录界面,一定要等我按F1选定WM之后再登录才会正常进入桌面。

我知道肯定是slim.conf或者xinitrc里什么地方不对劲,但是就是没看出问题所在,各位帮忙瞅瞅咋整喔

这是slim.conf

代码: 全选

# 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 /etc/X11/xinit/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

# Available sessions (first one is the default).
# The current chosen session name is replaced in the login_cmd
# above, so your login command can handle different sessions.
# see the xinitrc.sample file shipped with slim sources
sessions        Openbox,E17,KDE,pekwm,blackbox

# 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        adagi0

# 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          yes


# current theme, use comma separated list to specify a set to 
# randomly choose from
current_theme      archlinux-darch-grey 

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

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

# 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

# Available sessions (first one is the default).
# The current chosen session name is replaced in the login_cmd
# above, so your login command can handle different sessions.
# see the xinitrc.sample file shipped with slim sources
sessions        Openbox,E17,KDE,pekwm,blackbox

# 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        adagi0

# 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          yes


# current theme, use comma separated list to specify a set to 
# randomly choose from
current_theme      archlinux-darch-grey 

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

# Log file
logfile             /var/log/slim.log
这是~/.xinitrc,我要那种可启动多个WM,但默认会自动登录Openbox的效果,就从arch的wiki里抄来这个脚本,难道这里有问题?
貌似DEFAULT_SESSION=Openbox这一句不起作用,但下面的case语句又没问题

代码: 全选

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

setxkbmap -option terminate:ctrl_alt_bksp
xrdb -merge $HOME/.Xresources
xrdb -merge $HOME/.Xdefaults
export LANGUAGE=zh_CN.utf8
export LC_MESSAGES=zh_CN.utf8
export PATH=$PATH:/home/Scripts
numlockx &
export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=lcd'

export XMODIFIERS="@im=ibus"
export GTK_IM_MODULE=ibus
export QT_IM_MODULE=ibus


DEFAULT_SESSION=Openbox
case $1 in
    Openbox)
		exec ck-launch-session openbox-session
		;;
    Fluxbox)
		exec ck-launch-session startfluxbox
		;;
    Xfce4)
		exec ck-launch-session startxfce4
		;;
    KDE)
		exec ck-launch-session startkde
		;;
    Gnome)
		exec ck-launch-session gnome-session
		;;
    E17)
		exec ck-launch-session /usr/bin/enlightenment_start
		;;
    E16)
		exec ck-launch-session /usr/bin/starte16
		;;
    pekwm)
		exec ck-launch-session /usr/bin/pekwm
		;;
    ratpoison)
		exec ck-launch-session ratpoison
		;;
    awesome)
		exec ck-launch-session $HOME/bin/run_awesome
		;;
    dwm)
		exec ck-launch-session $HOME/bin/dwm_run
		;;
    wmii)
		until wmii; do true ; done
		;;
    icewm)
		exec icewm-session
		;;
    xmonad)
		exec ck-launch-session xmonad
		;;
    blackbox)
		exec ck-launch-session blackbox
		;;
	*)
	exec $session
	;;
esac
明天就换大三八!
——8核CPU、8G内存、8T硬盘……
8卡交火,80寸大屏放8个……
IPv8的光纤要8条……

---------------------------------------------------------------------------------
[图片版]新手当自强(续)FAQ
[新手进阶]挂载、fstab、调整linux分区
[图片版]E17桌面环境配置手把手
头像
leeaman
帖子: 30702
注册时间: 2007-02-02 18:14
系统: debian sid

Re: slim的脚本,到底怎么写才好捏?

#2

帖子 leeaman » 2010-08-29 12:30

没看出来 :em01
醉了星星,醉月亮●●●●●The Long Way To Go(*^_^*)
tusooa
帖子: 6548
注册时间: 2008-10-31 22:12
系统: 践兔
联系:

Re: slim的脚本,到底怎么写才好捏?

#3

帖子 tusooa » 2010-08-29 12:34

代码: 全选

*)exec $DEFAULT_SESSION;;
其实吾都只有一个session.

代码: 全选

] ls -ld //
头像
jarryson
帖子: 4002
注册时间: 2005-08-14 19:53

Re: slim的脚本,到底怎么写才好捏?

#4

帖子 jarryson » 2010-08-29 13:24

你就判断一下$1有没有内容就好了啊
P可弓虽
帖子: 68
注册时间: 2010-05-23 18:26
来自: China
联系:

Re: slim的脚本,到底怎么写才好捏?

#5

帖子 P可弓虽 » 2010-08-29 16:48

startx看看有什么提示
好吧
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

Re: slim的脚本,到底怎么写才好捏?

#6

帖子 eexpress » 2010-08-29 17:03

auth不对?

这啥rp。咋老出问题。
● 鸣学
头像
kumox
帖子: 2114
注册时间: 2008-04-14 23:29
来自: 曾也在NB大学呆过
联系:

Re: slim的脚本,到底怎么写才好捏?

#7

帖子 kumox » 2010-08-29 17:27

我以前 好像 是把case语句直接去掉的
case $1 in
Openbox)
exec ck-launch-session openbox-session
;;
Fluxbox)
exec ck-launch-session startfluxbox
;;
Xfce4)
exec ck-launch-session startxfce4
;;
KDE)
exec ck-launch-session startkde
;;
Gnome)
exec ck-launch-session gnome-session
;;
E17)
exec ck-launch-session /usr/bin/enlightenment_start
;;
E16)
exec ck-launch-session /usr/bin/starte16
;;
pekwm)
exec ck-launch-session /usr/bin/pekwm
;;
ratpoison)
exec ck-launch-session ratpoison
;;
awesome)
exec ck-launch-session $HOME/bin/run_awesome
;;
dwm)
exec ck-launch-session $HOME/bin/dwm_run
;;
wmii)
until wmii; do true ; done
;;
icewm)
exec icewm-session
;;
xmonad)
exec ck-launch-session xmonad
;;
blackbox)
exec ck-launch-session blackbox
;;
*)
exec $session
;;
esac
全去掉,中只留了
Openbox)
exec ck-launch-session openbox-session
;;
头像
kumox
帖子: 2114
注册时间: 2008-04-14 23:29
来自: 曾也在NB大学呆过
联系:

Re: slim的脚本,到底怎么写才好捏?

#8

帖子 kumox » 2010-08-29 17:27

错了勿怪
头像
adagio
论坛版主
帖子: 22110
注册时间: 2008-02-17 23:47
来自: 美丽富饶的那啥星球

Re: slim的脚本,到底怎么写才好捏?

#9

帖子 adagio » 2010-08-29 18:13

那不是不能选择进入其他WM了? :shock:
明天就换大三八!
——8核CPU、8G内存、8T硬盘……
8卡交火,80寸大屏放8个……
IPv8的光纤要8条……

---------------------------------------------------------------------------------
[图片版]新手当自强(续)FAQ
[新手进阶]挂载、fstab、调整linux分区
[图片版]E17桌面环境配置手把手
头像
leeaman
帖子: 30702
注册时间: 2007-02-02 18:14
系统: debian sid

Re: slim的脚本,到底怎么写才好捏?

#10

帖子 leeaman » 2010-08-29 18:16

估计有得选了不可以自动登录吧?一眼格格 :em06
醉了星星,醉月亮●●●●●The Long Way To Go(*^_^*)
头像
adagio
论坛版主
帖子: 22110
注册时间: 2008-02-17 23:47
来自: 美丽富饶的那啥星球

Re: slim的脚本,到底怎么写才好捏?

#11

帖子 adagio » 2010-08-29 18:30

不是吧 :em21
明天就换大三八!
——8核CPU、8G内存、8T硬盘……
8卡交火,80寸大屏放8个……
IPv8的光纤要8条……

---------------------------------------------------------------------------------
[图片版]新手当自强(续)FAQ
[新手进阶]挂载、fstab、调整linux分区
[图片版]E17桌面环境配置手把手
回复