Archlinux使用记录
目录
Xorg
查看默认DPI
xdpyinfo | grep -B2 resolution
取消fcitx空格上屏时自动追加空格
配置里面找:选择唯一候选词的长度限制,设置成0
Pacman
清理无用的软件包
$ sudo pacman -Rs $(pacman -Qtdq)
查询依赖
$ sudo pacman -Qi
查询文件属于哪个软件包
$ sudo pacman -Qo /path/to/file
获取已安装软件包所包含文件的列表
$ sudo pacman -Ql package_name
Archlinux包无效或损坏(PGP签名)
$ sudo pacman -S archlinux-keyring archlinuxcn-keyring $ sudo pacman-key --init $ sudo pacman-key --populate archlinux $ sudo pacman-key --refresh-keys
备份当前软件包 生成系统上安装的非本地软件包列表
$ comm -23 <(pacman -Qeq|sort) <(pacman -Qmq|sort) > .backup/pkglist
重装系统后,把pkglist复制到新系统
$ sudo pacman -S $(< .backup/pkglist)
GRUB2美化
1. 主题
安装主题
sudo pacman -S breeze-grub
启用主题
修改
/etc/default/grub
GRUB_THEME="/usr/share/grub/themes/breeze/theme.txt"
生成配置文件
sudo grub-mkconfig -o /boot/grub/grub.cfg
2. 字体
grub-mkfont用于将字体文件转换成pf2文件,用于grub的显示的字体文件。
sudo grub-mkfont -o ~/wqy-zenhei.pf2 -n wqy-zenhei fontname.ttc
-o 用来制定输出的文件,文件名一般以 pf2 为后缀,
-s 用来指定字体的大小,-n 用来制定字体的名字。将字体移至grub主题的文件夹中:
sudo mv ~/wqy-zenhei.pf2 /boot/grub/themes/Vimix/
- 修改主题配置文件,将新生成的字体替换。
使用grub-mkconfig命令更新grub:
sudo grub-mkconfig -o /boot/grub/grub.cfg
Lightdm
1. 安装
sudo pacman -S lightdm
2. 安装Greeter
greeter 是提示用户输入密码的 GUI 界面。
sudo pacman -S lightdm-gtk-greeter lightdm-gtk-greeter-settings
或:
sudo pacman -S lightdm-slick-greeter
3. 启用
sudo systemctl enable -f lightdm.service
4. 从SLIM迁移
mv .xinitrc .xprofile
删除调用 窗口管理器 或 桌面环境 的部分。
5. 双显卡黑屏解决方案
安装N卡驱动和xorg-xrandr:
$ sudo pacman -S nvidia nvidia-utils xorg-xrandr
新建文件 /etc/lightdm/display_setup.sh 并增加可执行权限,文件内容:
xrandr --setprovideroutputsource modesetting NVIDIA-0 xrandr --auto
在 /etc/lightdm/lightdm.conf 内增加语句:
display-setup-script=/etc/lightdm/display_setup.sh
生成 xorg.conf ,并修改内容:
$ sudo nvidia-xconfig
Section "Module" Load "modesetting" EndSection Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BusID "PCI:1:0:0" Option "AllowEmptyInitialConfiguration" EndSection
Udiskie和Dolphin自动挂载
安装和启用
sudo pacman -S udiskie
要在独立窗口管理器中启动udiskie作为后台程序,请在~/.xinitrc中添加以下行:
udiskie &
&表示程序将在后台运行,要停止udiskie,只需输入:
pkill udiskie
权限设置
1. 加入sotrage组
sudo gpasswd -a yoursaf storage
2. udiskie开启ntfs3读写权限
/etc/udisks2/mount_config.conf:
[defaults] ntfs_defaults=uid=$UID,gid=$GID, ntfs_allow=uid=$UID,gid=$GID,umask,dmask,fmask,locale,norecover,ignore_case,compression,nocompression,big_writes,nls,nohidden,sys_immutable,sparse,showmeta,prealloc,noatime
3. Dolphin开启权限
https://github.com/coldfix/udiskie/wiki/Permissions
https://gist.github.com/Scrumplex/8f528c1f63b5f4bfabe14b0804adaba7
Polkit rules for udisks, and udisks2. Compatible with udiskie and Dolphin.
Create the file /etc/polkit-1/rules.d/50-udiskie.rules
with permissions 644
, and
with the following contents:
// Original rules: https://github.com/coldfix/udiskie/wiki/Permissions // Changes: Added org.freedesktop.udisks2.filesystem-mount-system, as this is used by Dolphin. polkit.addRule(function(action, subject) { var YES = polkit.Result.YES; // NOTE: there must be a comma at the end of each line except for the last: var permission = { // required for udisks1: "org.freedesktop.udisks.filesystem-mount": YES, "org.freedesktop.udisks.luks-unlock": YES, "org.freedesktop.udisks.drive-eject": YES, "org.freedesktop.udisks.drive-detach": YES, // required for udisks2: "org.freedesktop.udisks2.filesystem-mount": YES, "org.freedesktop.udisks2.encrypted-unlock": YES, "org.freedesktop.udisks2.eject-media": YES, "org.freedesktop.udisks2.power-off-drive": YES, // Dolphin specific "org.freedesktop.udisks2.filesystem-mount-system": YES, // required for udisks2 if using udiskie from another seat (eg systemd): "org.freedesktop.udisks2.filesystem-mount-other-seat": YES, "org.freedesktop.udisks2.filesystem-unmount-others": YES, "org.freedesktop.udisks2.encrypted-unlock-other-seat": YES, "org.freedesktop.udisks2.eject-media-other-seat": YES, "org.freedesktop.udisks2.power-off-drive-other-seat": YES }; if (subject.isInGroup("storage")) { return permission[action.id]; } });
命令行禁用触摸板
1. 列出设备
$ xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Logitech M585/M590 id=10 [slave pointer (2)] ⎜ ↳ SYNA2B46:00 06CB:CD5F Mouse id=12 [slave pointer (2)] ⎜ ↳ SYNA2B46:00 06CB:CD5F Touchpad id=13 [slave pointer (2)]
2. 列出设备属性
$ xinput list-props devicename/ID
$ xinput list-props "SYNA2B46:00 06CB:CD5F Touchpad" Device 'SYNA2B46:00 06CB:CD5F Touchpad': Device Enabled (192): 1 Coordinate Transformation Matrix (194): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 Device Accel Profile (314): 1 Device Accel Constant Deceleration (315): 2.500000 Device Accel Adaptive Deceleration (316): 1.000000 Device Accel Velocity Scaling (317): 12.500000 Synaptics Edges (342): 46, 1125, 30, 541 ...... Synaptics Off (355): 0 ......
3. 设置设备属性
$ xinput set-prop device property values
$ xinput set-prop "SYNA2B46:00 06CB:CD5F Touchpad" "Synaptics Off" 1
or
$ xinput set-prop 13 355 1
4. 启动桌面时自动禁用
~/.xprofile:
xinput set-prop "SYNA2B46:00 06CB:CD5F Touchpad" "Synaptics Off" 1
dolphin
- dolphin无法搜索本地文件,可运行
balooctl check
重新进行索引。
显卡检测
列出显卡型号
$ lspci -k | grep -A 2 -E "(VGA|3D)"
安装
mesa-demos
,用以下命令可以查看当前在用的显卡驱动。glxinfo | grep -i intel or: glxinfo | grep -i nvidia
安装
virtualgl
glxspheres64 可以用来检测帧数。
电源管理
1. 软件包
安装软件包 acpid
,并启动服务:
$ sudo pacman -S acpid $ sudo systemctl enable acpid.service
安装软件包 mate-power-manager
,编辑~/.xprofile:
mate-power-manager &
2. 设置
检测按键
journalctl -f or: acpi_listen
插拔外接电源时自动设置屏幕亮度
- 检查
/sys/class/backlight/intel_backlight/max_brightness
的数值。 修改
/etc/acpi/handler.sh
:ac_adapter) case "$2" in AC|ACAD|ADP|ACPI*) case "$4" in 00000000) logger 'AC unpluged' echo -n 72000 > /sys/class/backlight/intel_backlight/brightness ;; 00000001) logger 'AC pluged' echo -n 120000 > /sys/class/backlight/intel_backlight/brightness ;; esac ;; *) logger "ACPI action undefined: $2" ;; esac ;;
管理笔记本的音量键
/etc/acpi/events/vol-d
event=button/volumedown action=amixer set Master 5-
/etc/acpi/events/vol-m
event=button/mute action=amixer set Master toggle
/etc/acpi/events/vol-u
event=button/volumeup action=amixer set Master 5+
无线网络自动连接
sudo systemctl enable netctl.service sudo netctl enable yourprofile
Wps-office
wps-office-cn 的可选依赖:
cups: for printing support libjpeg-turbo: JPEG image codec support [已安装] pango: for complex (right-to-left) text support [已安装] curl: An URL retrieval utility and library [已安装] ttf-wps-fonts: Symbol fonts required by wps-office ttf-ms-fonts: Microsft Fonts recommended for wps-office wps-office-fonts: FZ TTF fonts provided by wps community wps-office-mime-cn: Use mime files provided by Kingsoft wps-office-mui-zh-cn: zh_CN support for WPS Office