Arch :: Configuration

System Configuration

ln -s $(command neovim) /usr/local/bin/vi
ln -s /usr/bin/doas /usr/local/bin/sudo

# create a symlink to xterm can help some desktop files
ln -s /usr/bin/foot /usr/local/bin/xterm

Power Management

# better leave to WM/DE, can adjsut systemd here
/etc/systemd/logind.conf

Disable PC Speaker Beep

#/etc/modprobe.d/nobeep.conf
blacklist pcspkr

Auth Agent

# install `polkit-gnome` pkg
# exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1

# `fprintd` for finger print
#edit
/etc/pam.d/{login,su,sudo}
auth sufficient	pam_unix.so try_first_pass likeauth nullok
auth sufficient	pam_fprintd.so

UFW

pacman -Syu ufw #install ufw
ufw default deny
ufw allow from 192.168.0.0/24
ufw limit ssh
less /etc/services #check all services
ufw limit 5900
ufw enable
systemctl enable ufw.service
ufw status

NetworkManager MAC spoofing

# install `macchanger`
# Put down interface
ip link show wlan0
ip link set wlan0 down
macchanger -r wlan0
ip link set wlan0 up

# auto
/etc/systemd/system/macspoof@.service
[Unit]
Description = macchanger on %I
Wants=network-pre.target
Before=network-pre.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device

[Service]
ExecStart=/usr/bin/macchanger -e %I
Type=oneshot

[Install]
WantedBy=multi-user.target
/etc/NetworkManager/conf.d
# wifi_rand_mac.conf
[device-mac-randomization]
# "yes" is already the default for scanning
wifi.scan-rand-mac-address=yes

[connection-mac-randomization]
# Randomize MAC for every ethernet connection
ethernet.cloned-mac-address=random
# Generate a random MAC for each WiFi and associate the two permanently.
wifi.cloned-mac-address=stable

shell

chsh -l # list all shells
# alternatively, edit /etc/passwd file
chsh -s /path/to/shell

pacman

/etc/pacman.d/hooks/100-custom.hook
EDITOR /etc/pacman.conf # to enable color option
pacman-contrib # pacccahe
archlinux-contrib   # checkupdates & checkservices

doas

/etc/doas.conf  # need to create
permit :wheel as root
permit nopass username as root # no pass for all cmd
permit nopass username as root cmd pacman
permit no pass username as root cmd pacman args -Syu

Fonts

# fonts
ttf-font-awesome
ttf-symbols-nerd-font
noto-fonts-cjk

# useful commands
fc-list     # list all fonts
fc-list ':charset=f303'     # display fonts that contain char
fc-match -a monospace       # list all fonts that support monospace, in order
fc-cache

dotfiles

system backup

disk

systemctl enable fstrim.timer
pacman -Syu smartmontools

update udev and polkit rules

BIOS and Firmware

swap

# create swapfile
dd if=/dev/zero of=/swapfile bs=1G count=10 status=progress # change 10 to desired size
chmod 600 /swapfile
mkswap /swapfile # format
swapon /swapfile # activate
echo "/swapfile none swap defaults 0 0 " >> /etc/fstab

#check swap status
swapon --show

# remove
swapoff /swapfile
rm -f /swapfile

utilities

tree # list directories and files
tldr # man but simple, tealdeer is a rust implement and faster
ncdu # better du
bat # cat replacement
exa # ls replacement
fzf # fuzzy find
jq # JSON parse tool
rmlint # system cleaning
tig # git UI

onefetch    # neofetch for git repo
bottom  # btm, top but better

zathura, zathura-pdf-mupdf  # for pdf
foliate

#media
playerctl
mpv
mpv-mpris   # needed for playerctl to talk to mpv

Application

Set Default Application

~/.config/mimeapps.list

[Default Applications]
application/pdf=org.pwmt.zathura.desktop

Hide certain entries

# location of Applications shortcuts
cd /usr/share/applications
# -l: return the name of any file containing this string
# -i: case insensaitive
grep -li "FLUID" /usr/share/applications/* | pacman -Qo -
## hide a desktop menu
cp /usr/share/applications/pkg.desktop ~/.local/share/applications/
EDIT pkg.desktop
    NoDisplay=true

Sync time

systemctl enable systemd-timesyncd.service
## check
timedatectl status

Wayland

# firefox wayland mode
# change firefox.desktop
Exec=env MOZ_ENABLE_WAYLAND=1 /usr/lib/firefox/firefox %u
about:support # check window protocol
about:config
gfx.webrender.compositor.force-enabled # set to true

# qt5
# install `qt5-wayland` pkg
# the following env may be necessary too
QT_QPA_PLATFORM=wayland

TTY

auto-login to tty

# add additional virtual consoles
EDIT /etc/systemd/logind.conf
    NAutoVTs=N # N being the number of virtual terminals
systemctl start getty@ttyN.service # start one temporarily

# auto login to virtual console
# equivalent to EDIT /etc/systemd/system/getty@tty1.service.d/override.conf
systemctl edit getty@tty1
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin username --noclear %I $TERM
# prompt only pwd
ExecStart=-/sbin/agetty -n -o username %I

change tty font

pacman -Syu terminus-font # for bigger font
# available fonts
ls /usr/share/kbd/consolefonts
# temp change
setfont lat2-16 -m 8859-2
# permanent change
EDIT /etc/vconsole.conf
    FONT=lat2-16
    FONT_MAP=8859-2

prevent journal log to tty

EDIT /etc/systemd/journald.conf
    ForwardToWall=no