Arch Linux Configuration Guide

2020/10/25

硬件

触控板优化

sudo vim /usr/share/X11/xorg.conf.d/40-libinput.conf

Option "Tapping" "on"
Option "NaturalScrolling" "true"

reboot

自动挂载windows分区

sudo mkdir /media && sudo mkdir /media/Windows && sudo mkdir /media/Data

sudo vim /etc/fstab

/dev/sda4       /media/Windows    ntfs-3g         uid=huizhi,gid=users,dmask=022,fmask=133    0       0
/dev/sdb2       /media/Data    ntfs-3g         uid=huizhi,gid=users,dmask=022,fmask=133    0       0

Nvidia显卡

方案一:

prime方案

yay -S nvidia nvidia-prime

方案二:

禁用Nvidia显卡

安装bbswitch:

sudo pacman -S bbswitch

开机加载bbswitch模块:

sudo vim /etc/modules-load.d/bbswitch.conf

键入:

bbswitch

设置bbswitch加载参数,实现开机时关闭独显,关机时开启独显,避免重启进入Windows时找不到独显:

sudo vim /etc/modprobe.d/bbswitch.conf

键入:

options bbswitch load_state=0 unload_state=1

屏蔽nouveau驱动:

sudo vim /etc/modprobe.d/blacklistnvidia.conf

键入:

blacklist nouveau

重建 initrd:

sudo mkinitcpio -p linux

重启:

reboot

执行:

lspci | grep NVIDIA

如有 (rev ff)字样 ,则表示独显已成功禁用。

软件

软件仓库

修改镜像列表:

sudo vim /etc/pacman.d/mirrorlist

Server = https://mirrors.xjtu.edu.cn/archlinux/$repo/os/$arch
Server = https://mirrors.bfsu.edu.cn/archlinux/$repo/os/$arch
Server = https://mirrors.sjtug.sjtu.edu.cn/archlinux/$repo/os/$arch
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch

Archlinuxcn源:

sudo vim /etc/pacman.conf

[archlinuxcn]
Server = https://mirrors.xjtu.edu.cn/archlinuxcn/$arch

sudo pacman -Syy && sudo pacman -S archlinuxcn-keyring

AUR:

sudo pacman -S yay

建立常用目录(的软链接)

cd ~

mkdir Desktop Documents Downloads && ln -s /media/Data/Videos Videos && ln -s /media/Data/Music Music && ln -s /media/Data/Pictures Pictures && ln -s /media/Data/Hugo Hugo

从Windows安装字体

sudo mkdir /usr/share/fonts/WindowsFonts && sudo cp /media/Windows/Windows/Fonts/* /usr/share/fonts/WindowsFonts && sudo chmod 755 /usr/share/fonts/WindowsFonts/* && fc-cache -f

恢复配置文件

git clone https://github.com/qvshuo/dotfiles.git

rsync -r --exclude ".git/" --exclude "LICENSE" --exclude "README.md" --exclude "inbox-imap-python.py" --exclude "openweathermap-simple.sh" ~/dotfiles/ ~/

fish

取消欢迎语:

fish

set -U fish_greeting

Firefox

about:config

退格键返回:(将值由2改成0)
browser.backspace_action

双击关闭标签页:
browser.tabs.closeTabByDblclick

Enable OpenGL compositor:
layers.acceleration.force-enabled

Enable WebRender compositor:
gfx.webrender.all

true:
media.ffmpeg.vaapi.enabled

false:
media.ffvpx.enabled

终结内容农村

https://raw.githubusercontent.com/danny0838/content-farm-terminator/gh-pages/files/blocklist/content-farms.txt

网易云音乐

sudo vim /usr/share/applications/netease-cloud-music-gtk.desktop

Icon=/usr/share/icons/Qogir/scalable/apps/netease-cloud-music.svg

vsftpd

sudo vim /etc/vsftpd.conf

local_enable=YES
write_enable=YES

sudo systemctl enable --now vsftpd.service

nginx

sudo vim /etc/nginx/nginx.conf

http {
	server
		listen	8765;
		
		charset utf-8;
		
	    location / {
            root   /media/Data/Videos;
            autoindex on;
            autoindex_exact_size off;
            autoindex_localtime on;
        }
}

sudo systemctl enable --now nginx.service

polybar

天气

yay -S jq

yay -S ttf-weather-icons(代理)

图标

yay -S nerd-fonts-roboto-mono(代理)

ibus

ibus-setup

celluloid

--hwdec=auto

git

git config --global user.name "qvshuo" && git config --global user.email qvshuo@foxmail.com

scrcpy

sudo adb devices

sudo adb tcpip 5556

sudo adb connect 192.168.3.120:5556

scrcpy -b 6M --window-title 'MEIZU 16s' --stay-awake

cron

sudo systemctl enable --now cronie.service

crontab -e

0 * * * * export DISPLAY=:0 && nitrogen --set-zoom-fill --random &
15 8 * * * export DISPLAY=:0 && alacritty -e mpv --no-config --loop ~/Videos/alarm.mp4 &

获取程序名称

xprop | grep WM_CLASS

获取中文字体列表

fc-list :lang=zh

Sarasa Gothic SC

Source Han Serif SC

Sarasa Mono SC

Font Awesome 5 Free Solid

Weather Icons

RobotoMono Nerd Font

使Windows使用UTC时间

Windows下以管理员权限运行:

reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /d 1 /t REG_QWORD /f