debian13初始化优化

在xubuntu,我们的登陆界面是很正常的,有图标,有默认的用户名,但是发现xfce版本的debian13居然什么都没有。而且发现笔记本的触摸板也是各种问题。

由于xfce是基于lightdm的,所以很多修改都是改的lightdm, 这个跟现在kde和gnome有很大区别的。

修改登陆头像

首先看看对应的配置:

1
2
3
4
5
cat /etc/lightdm/lightdm-gtk-greeter.conf

[greeter]
hide-user-image = false
default-user-image = /var/lib/AccountsService/icons/timo

很好理解的,不隐藏用户头像,头像的位置。

然后就看下对应头像位置是否有对应文件,如果没有就复制一个过来就行,png或者jpg这些都支持

1
2
ll /var/lib/AccountsService/icons/timo                                                                                        
-rw-r--r-- 1 root root 82K 9月 5日 14:05 /var/lib/AccountsService/icons/timo

然后看下AccountsService配置是否正确, 这里还能设置登陆时候的桌面背景。

1
2
3
4
5
6
7
8
9
10
sudo cat /var/lib/AccountsService/users/timo

[org.freedesktop.DisplayManager.AccountsService]
BackgroundFile=''

[User]
Session=
XSession=xfce
Icon=/var/lib/AccountsService/icons/timo
SystemAccount=false

设置默认登陆账户

首先查看对应配置, 这里主要就是把 greeter-hide-users设置为false

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
sudo apt install slick-greeter -y

cat /etc/lightdm/lightdm.conf | grep -v ^#

[Seat:*]
[LightDM]

[Seat:*]
greeter-session=lightdm-greeter
greeter-hide-users=false
user-session=xfce

[XDMCPServer]

[VNCServer]

三指切换

Debian13 默认已使用 libinput。如果你当前还在用 synaptics就先删除了。很多老的教程里还在用synaptics

1
sudo apt remove xserver-xorg-input-synaptics

安装libinput-gestures 及依赖

1
2
3
4
5
6
7
8
9
10
11
sudo apt install xserver-xorg-input-libinput libinput-tools
sudo apt install xdotool wmctrl git
sudo gpasswd -a $USER input

# 系统注销一下

git clone https://github.com/bulletmark/libinput-gestures.git
cd libinput-gestures
sudo ./libinput-gestures-setup install

cp /etc/libinput-gestures.conf ~/.config/

配置ibinput-gestures.conf文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
cat ~/.config/libinput-gestures.conf

# ============================================
# libinput-gestures.conf
# 完整配置:三指滑动切换窗口 + 常用手势
# ============================================

# --------------------------------------------
# 三指滑动 = Alt+Tab 切换窗口
# --------------------------------------------
# 三指向左滑:反向切换(Alt+Shift+Tab)
gesture swipe left 3 xdotool key alt+Shift+Tab

# 三指向右滑:正向切换(Alt+Tab)
gesture swipe right 3 xdotool key alt+Tab

# --------------------------------------------
# 可选:四指手势(桌面/工作区切换)
# --------------------------------------------
# 四指上滑:打开概览/显示所有窗口(GNOME/KDE 通用)
gesture swipe up 4 xdotool key super

# 四指下滑:显示桌面
gesture swipe down 4 xdotool key super+d

# 四指左右:切换工作区/虚拟桌面
gesture swipe left 4 xdotool key ctrl+alt+Left
gesture swipe right 4 xdotool key ctrl+alt+Right

# --------------------------------------------
# 可选:捏合手势
# --------------------------------------------
# 双指捏合:缩小(Ctrl+-)
gesture pinch in 2 xdotool key ctrl+minus

# 双指张开:放大(Ctrl++)
gesture pinch out 2 xdotool key ctrl+plus

# --------------------------------------------
# 配置说明
# --------------------------------------------
# 格式:gesture <type> <direction> <finger_count> <command>
# <type> : swipe | pinch
# <direction>: up | down | left | right | in | out
# <finger_count>: 2 | 3 | 4 | 5(取决于硬件支持)
# <command> : 任意 shell 命令,这里用 xdotool 模拟按键

启动并设置开机自动启动

1
2
libinput-gestures-setup start
libinput-gestures-setup autostart

打字时候禁用触摸板

libinput-gestures.conf` 只管手势(滑动/捏合),而触摸板右键和打字时禁用触摸板是 libinput Xorg 驱动的配置,需要写在 /etc/X11/xorg.conf.d/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
cat /etc/X11/xorg.conf.d/90-touchpad.conf

# ============================================
# 90-touchpad.conf
# libinput 触摸板驱动完整配置
# ============================================

Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"

# ---- 点击相关 ----
# 启用触摸点击(单指轻触 = 左键)
Option "Tapping" "on"

# 点击按钮映射:lrm = Left(1指) Right(2指) Middle(3指)
# 即:单指点击=左键,双指点击=右键,三指点击=中键
Option "TappingButtonMap" "lrm"

# 按压方式:clickfinger = 多指按压(1指按压=左键,2指按压=右键)
# 如果你的触摸板支持 Force Touch/压力感应,推荐用这个
Option "ClickMethod" "clickfinger"

# ---- 打字时禁用触摸板 ----
# 打字时自动禁用触摸板,防止误触(默认已开启,这里显式确认)
Option "DisableWhileTyping" "true"

# ---- 滚动相关 ----
# 双指滚动
Option "ScrollMethod" "twofinger"

# 自然滚动(类似 macOS,反向滚动。不需要的话改成 "false")
Option "NaturalScrolling" "false"

# 水平滚动
Option "HorizontalScrolling" "true"

# ---- 加速与手感 ----
# 指针速度,范围 -1.0(慢)到 1.0(快),默认 0.0
Option "AccelSpeed" "1"
Option "AccelProfile" "flat"

# ---- 拖拽相关 ----
# 启用 tap-and-drag(轻触后按住拖动)
Option "TappingDrag" "on"

# 拖拽锁定(抬起手指后短时间内再次放下可继续拖动)
Option "TappingDragLock" "off"

# ---- 中键模拟 ----
# 同时按下左右键模拟中键(不需要的话改成 "false")
Option "MiddleEmulation" "false"

# ---- 左手模式 ----
# 左右键互换(左撇子用,默认关闭)
Option "LeftHanded" "false"
EndSection

XFCE 的 xfsettingsd 在登录时会从 ./xfce4/xfconf/xfce-perchannel-xml/pointers.xml 读取鼠标/触摸板设置,覆盖 xorg.conf.d 里的配置

不过这块完全可以从图形界面里操作。

mouse-setting