ArchLinux NoDM 安装

有些人不愿意安装DM,这样系统也能正常使用,而且更加精简,下面列出ArchLinux 不装DM,只装openbox的方式

但是注意,某些软件需要DM来运行,例如向日葵远程控制,还是需要安装lightDM,否则只能控制其他主机,不能受控。

 

 

#xinit必须安装,因为xinit=startx

pacman -S xorg-server xorg-xrdb xorg-xinit
pacman -S openbox obconf ttf-dejavu ttf-liberation xterm
pacman -S xf86-video-vmware xf86-input-vmmouse
pacman -S open-vm-tools gtkmm


1. Using systemd to autologin a user.

Create a directory named getty@tty1.service.d and a file in it called override.conf in the following location.

/etc/systemd/system/getty@tty1.service.d/override.conf

Here's what you'd add to that override.conf file.

    [Service]
    Type=simple
    ExecStart=
    ExecStart=-/sbin/agetty --autologin yourusername --noclear %I 38400 linux

That's what it'll do, automatically login the user named, where it says yourusername. Put the desired username there.

2. To automatically startx edit the .profile file in your users /home directory and add this to the bottom.

#Startx Automatically
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
. startx
logout
fi

 

#创建X11的default xinitrc script
cp /etc/X11/xinit/xinitrc ~/.xinitrc
修改~/.xinitrc最后几行为
xrandr --output Virtual1 --mode 1920x1080
exec openbox-session

 

openbox 修改字体大小
I edited the file ~/.Xresources
Xft.dpi: 192

openbox 设置背景色
先安装xorg-xsetroot
然后在~/.config/openbox/autostart中加入
xsetroot -solid "#303030" &


openbox 安装panel
先安装tint2
然后在~/.config/openbox/autostart中加入
tinit2 &


openbox 安装polkit
sudo pacman -S polkit polkit-gnome
然后在~/.config/openbox/autostart中加入
sleep 1 && /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &


Running GUI applications as root:
These methods will allow root to connect to a non-root user's X server, but present varying levels of security risks, especially if you run ssh. If you are behind a firewall, you may consider them to be safe enough for your requirements.
Add the following line to /etc/profile:

export XAUTHORITY=/home/username/.Xauthority


#安装中文字体
pacman -S ttf-sarasa-gothic noto-fonts-cjk


#安装中文输入法
pacman -S fcitx-im
选地一个就行
在不开启fcitx的情况下修改配置文件,否则可能被还原:
~/.config/fcitx/profile
将EnabledIMList=pinyin-libpinyin:TRUE
设置为TRUE即可

然后在~/.config/openbox/autostart中加入
fcitx &
ArchWiki说如果启动不了后面加延时 sleep 2

~/.pam_environment
环境变量文件加入,其他配置文件加也行,但是ArchWiki说不要加到.bashrc
GTK_IM_MODULE DEFAULT=fcitx
QT_IM_MODULE  DEFAULT=fcitx
XMODIFIERS    DEFAULT=\@im=fcitx


Now say you have several DE's/WM's installed. You'll obviously want to be able to pick and switch between them. This is where update-alternatives comes into it.

Enter the following command to pick which will be the default xsession, until it's changed.

sudo update-alternatives --config x-session-manager

Select the one you want to be default and you're good to go. ALMOST. Most DE's etc will be well behaved and will add a selection for themselves to x-session-manager for you. However sometimes I've found that won't be the case however you can add an entry for it yourself. ie: Let's take fluxbox by way of example. I want to add it to the x-session-manager section of update-alternatives, so I can choose it there whenever I want. Here's how ...

sudo update-alternatives --install /usr/bin/x-session-manager x-session-manager /usr/bin/fluxbox 40

In the above, I'm installing something to the x-session-manager group of update-alternatives, in this case, fluxbox, /usr/bin/fluxbox is where fluxbox errrr, lives big_smile and I'm giving it a priority of 40 there. Although it doesn't overly matter. Once it's selected it'll launch as default x-session until something else is chosen.

NOTE: Ok another scenario, the above is perfectly fine for a single user system but what about a multi-user one or one on which you want to be able to login more than one username. Easy, peasy, just skip step 1 (or remove the directory/override.conf file. You'll be met with a command-line login to enter the user and password you want to use.

Finally, you likely already have a display manager running. For all this automagic-ness to work, you'll have to change that. Couple options, remove the display manager from your OS, you can always reinstall it later if desired. Another would be to use "sudo systemctl disable lightdm" to disable lightdm and keep it from automatically starting every time the system boots up. If at some point in future you wish, re-enable the sucker with "sudo systemctl enable lightdm"

posted on 2022-04-10 19:13  ctcrst  阅读(217)  评论(0编辑  收藏  举报