[Gentoo] SLiM 登入管理程式與 GNOME 自動掛載

現在的登入畫面

現在的登入畫面

話說切到 GNOME 3 已經有一段時間了,用起來都還不錯,唯一比較惱人的一點是新版的 GDM 沒有佈景主題這東西,連要改個背景都很麻煩……於是一氣之下,決定找個其他的登入管理程式來用,反正 Gentoo 沒別得優點,就是選擇多。

最後看中的是 SLiM 這套,因為他的啟動速度真的超級快,一眨眼就跑起來了,而且佈景主題的設定也很簡單,就是幾個純文字設定檔和圖檔套一套而已,所以就決定使用這套,並且把登入畫面換成發著聖母光芒(?)的遠子學姐了。lol

但剛開始用的時候卻發現,進到 GNOME 之後,USB 隨身碟和讀卡機的自動掛載不能用了,試了半天之後才發現是我登入的指令設錯了,所以在這邊筆記一下所有設定的過程。

安裝 SLiM 以及佈景主題

要在 Gentoo 下安裝 SLiM 和佈景主題,當然只要 emerge 一下就好啦!套件名稱是 slimslim-themes,只是記得要開 consolekitpam 這兩個選項。

# USE="consolekit pam" emerge slim slim-themes

設定登入 GNOME 3

要讓 SLiM 預設成使用者輸入密碼後,就進入 GNOME 3 的話,要更改 /etc/slim.conf 設定檔,重點是在 login_cmd 選項,將這個選項設成如下的狀況,就可以登入 GNOME 囉。

# 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
login_cmd           exec /bin/bash -login /usr/share/slim/Xsession GNOME

設定 Gentoo 使用 SLiM 做為登入管理員

當 SLiM 設定完成之後,還要設定 Gentoo 預設使用 SLiM 做為登入管理程式。

要達成這樣的目的也很簡單,只要編輯 /etc/conf.d/xdm 這個檔案,並且把 DISPLAYMANAGER 這個變數設成 slim 就好囉,編輯完後檔案應該會長得像這面這樣:

# We always try and start X on a static VT. The various DMs normally default
# to using VT7. If you wish to use the xdm init script, then you should ensure
# that the VT checked is the same VT your DM wants to use. We do this check to
# ensure that you haven't accidentally configured something to run on the VT
# in your /etc/inittab file so that you don't get a dead keyboard.
CHECKVT=7

# What display manager do you use ?  [ xdm | gdm | kdm | gpe | entrance ]
# NOTE: If this is set in /etc/rc.conf, that setting will override this one.
DISPLAYMANAGER="slim"

最後,只要重新開機,或者是離開 X Window 後重新啟動 xdm 服務就可以了。 :)

# /etc/init.d/xdm restart

回響