Arch Linux Configuration Guide

2020/10/25

更新于2021.2

硬件

配置触控板

proxychains paru -S ruby-fusuma ruby-fusuma-plugin-sendkey

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

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

reboot

自动挂载资料分区并修改所有者及权限

sudo mkdir /data

sudo nvim /etc/fstab

/dev/sdb1	/data	ext4	defaults	0	0

sudo mount -a

cd /data

设置所有文件权限为644:

sudo find ./ -type f -exec chmod 644 {} \;

设置所有目录权限为755:

sudo find ./ -type d -exec chmod 755 {} \;

Nvidia显卡

方案一:

禁用Nvidia显卡

安装bbswitch:

sudo pacman -S bbswitch

开机加载bbswitch模块:

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

键入:

bbswitch

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

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

键入:

options bbswitch load_state=0 unload_state=1

屏蔽nouveau驱动:

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

键入:

blacklist nouveau

重建 initrd:

sudo mkinitcpio -P

重启:

reboot

执行:

lspci | grep NVIDIA

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

方案二:

prime方案

paru -S nvidia nvidia-prime

加快关机速度

sudo nvim /etc/systemd/system.conf

DefaultTimeoutStopSec=3s

软件

proxychains

sudo nvim /etc/proxychains.conf

quiet_mode
# proxy_dns
http    127.0.0.1   7890

建立常用目录的软链接

cd ~ && ln -s /data/Videos Videos && ln -s /data/Music Music && ln -s /data/Pictures Pictures && ln -s /data/Hugo Hugo

创建默认目录

paru -S xdg-user-dirs

LC_ALL=C xdg-user-dirs-update --force

git

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

ssh-keygen -t rsa -C qvshuo@foxmail.com

cat ~/.ssh/id_rsa.pub

ssh -T git@github.com

恢复配置文件

proxychains git clone git@github.com:qvshuo/dotfiles.git

./rsync

fish

取消欢迎语:

set -U fish_greeting

样式设置:

fish_config

Firefox

about:config

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

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

Hardware video acceleration:

true:
media.ffmpeg.vaapi.enabled

false:
media.ffvpx.enabled

终结内容农场

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

vsftpd

sudo nvim /etc/vsftpd.conf

local_enable=YES
write_enable=YES

sudo systemctl enable --now vsftpd.service

nginx

sudo nvim /etc/nginx/nginx.conf

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include  mime.types;
    default_type  octet-stream;

    server {
        listen  8765;

        location / {
            root   /data/Videos;
            autoindex on;
            autoindex_exact_size off;
            autoindex_localtime on;
            charset utf-8;
	    add_before_body /autoindex/before.html;
	    add_after_body /autoindex/after.html;
        }

    }

}

sudo systemctl enable --now nginx.service

hsetroot

cd ~/Desktop

proxychains git clone git@github.com:qvshuo/dynamic_wallpaper.git

polybar

脚本

cd ~/Desktop

proxychains git clone git@github.com:qvshuo/polybar-scripts.git

paru -S jq

ibus

ibus-setup

Rime同步

nvim ~/.config/ibus/rime/installation.yaml

installation_id: "rimesync"
sync_dir: /data/我的坚果云

nautilus

gsettings set com.github.stunkymonkey.nautilus-open-any-terminal terminal alacritty

scrcpy

有线:

sudo adb devices

无线:

sudo adb tcpip 5556 && adb connect 192.168.3.120:5556

cron

sudo systemctl enable --now cronie.service

crontab -e

0 * * * * export DISPLAY=:0 && /home/huizhi/Desktop/dynamic_wallpaper/run.sh &
15 7 * * * export DISPLAY=:0 && alacritty -e mpv --loop ~/Videos/alarm.mp4 &

获取程序名称

xprop | grep WM_CLASS

获取中文字体列表

fc-list :lang=zh

Sarasa Gothic SC

Source Han Serif SC

Sarasa Mono SC

安装Windows字体

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