-
Disable bell sound
To disable bell sound on tab-completion, uncomment the line
set bell-style none
in/etc/inputrc
. Edit/etc/vimrc
add lineset belloff=all
afterruntime! archlinux.vim
, to disable bell sound in vim. Then relogin to take effect. Add lineexport LESS="$LESS -Q"
to the end of/etc/profile
also disable the bell sound inless
. -
Default editor
Add line
export EDITOR=/usr/bin/vim
to the end of/etc/profile
to set vim as default editor. -
Add new admin user
tux
,# useradd -m -G wheel tux # passwd tux
Edit
sudoers
file withvisudo
command. Uncomment%wheel ALL=(ALL) ALL
allow members inwheel
group gainsudo
access, or%wheel ALL=(ALL) NOPASSWD: ALL
execute any command without password (insecure!). -
Enable parallel download for
pacman
Uncomment line
ParallelDownloads
in/etc/pacman.conf
. -
Install
reflector
to select the most up-to-date mirrors based on country. Edit configuration file/etc/xdg/reflector/reflector.conf
--save /etc/pacman.d/mirrorlist --country us --protocol https --latest 5 --sort age
and enable
reflector.timer
to update mirrorlist weekly. -
Install AUR helper
paru
. First installbase-devel
package group, thenmkdir -p ~/.cache/paru cd ~/.cache/paru git clone https://aur.archlinux.org/paru.git cd paru makepkg -si
-
Install
pacman-contrib
package, then enablepaccache.timer
to delete unused pacman cache weekly. -
Enable
fstrim.timer
provided byutil-linux
package for Periodic SSD TRIM. -
To setup btrfs snapshot and rollback solution, install
snapper
andcronie
package, then follow this guide.# umount /.snapshots # rm -r /.snapshots # snapper -c root create-config / # btrfs subvolume delete /.snapshots # mkdir /.snapshots
The btrfs subvolumes layout in the Arch Linux installation note already follows this suggested guide layout, so the mount entry already in
fstab
.# mount -a # chmod -R 750 /.snapshots
Also create new config for home
# snapper -c home create-config /home
Edit snapshots limit for both root and home in config files
/etc/snapper/configs/root
and/etc/snapper/configs/home
.NUMBER_MIN_AGE="1800" NUMBER_LIMIT="10" NUMBER_LIMIT_IMPORTANT="10" TIMELINE_MIN_AGE="1800" TIMELINE_LIMIT_HOURLY="5" TIMELINE_LIMIT_DAILY="7" TIMELINE_LIMIT_WEEKLY="0" TIMELINE_LIMIT_MONTHLY="0" TIMELINE_LIMIT_YEARLY="0"
To restore to previous state, follow this guide.
-
Automatically creating snapshots upon a pacman transaction
Install
rsync
andsnap-pac
package, then create pacman hook/etc/pacman.d/hooks/50-bootbackup.hook
to backup /boot partition[Trigger] Operation = Upgrade Operation = Install Operation = Remove Type = Path Target = usr/lib/modules/*/vmlinuz [Action] Depends = rsync Description = Backing up /boot... When = PostTransaction Exec = /usr/bin/rsync -a --delete /boot /.bootbackup
-
dotfiles restore, based on this guide
-
Login as user
tux
. -
clone git-directory
$ git clone --bare <dotfiles-repo-url> $HOME/.dotfiles $ alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
-
checkout. Because there may be some files like
.bashrc
or.gitignore
in the home directory, first remove (since this is fresh installed system, we simply delete them) these conflicted files then checkout.$ dotfiles checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} rm {} $ dotfiles checkout
-
Let
git status
ignore untracked file$ dotfiles config --local status.showUntrackedFiles no
-
Or you can put all these command in a single script like this, then
cd ~ curl -O https://raw.githubusercontent.com/Bai-Chiang/Linux_tinkering_notes/main/restore_dotfiles.sh bash restore_dotfiles.sh
-
After setting up the desktop environment and ssh key (see below), follow this guide copy public key to GitHub via web interface. Then change the remove url in
~/.dotfiles/config
... [remote "origin"] url = [email protected]:Bai-Chiang/dotfiles.git ...
Then you can push to github repository using
dotfiles push
You may need extra setup for the first time, follow the hints/suggestions.
-
-
install
openssh
package.Generate new key pair
$ ssh-keygen -t ed25519
to copy public key to remote server with ssh port 2222
ssh-copy-id -i ~/.ssh/id_ed25519.pub -p 2222 [email protected]
-
Wifi set up, use iwd or wpa_supplicant (I can't connect to MSCHAPv2 network with
iwd
, but it works withwpa_supplicant
.) Installiwd
and enableiwd.service
. Check whether wifi is block using commandrfkill list
. To unblock all wifi/bluetooth userfkill unblock all
, and reboot. Login as admin usertux
.Connect wifi with an interactive prompt with command
iwctl
, follow this to connect to wifi. eduroam setup follow this guide. -
GUI
-
Install desktop environment/window manager
-
set up XDG user directories by installing
xdg-user-dirs
then runxdg-user-dirs-update
. -
Install extra fonts (like
ttf-dejavu
), CJK fonts (noto-fonts-cjk
), Emoji and Kaomoji, andttf-font-awesome
. -
PipeWire and
pavucontrol
-
Add flatpak repo
flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
To automatically update flatpak applications everyday, create this service file
~/.config/systemd/user/flatpak-update.service
[Unit] Description=Update flatpak StartLimitIntervalSec=3h StartLimitBurst=5 OnFailure=failure-notification@%n [Service] Type=oneshot ExecStart=/usr/bin/flatpak update --assumeyes Restart=on-failure RestartSec=30min
It try to update all flatpak packages, if failed it will retry at most 5 times every 30min. If this service failed it will send a notification through another systemd service
~/.config/systemd/user/[email protected]
[Unit] Description=Send a notification about a failed systemd unit [Service] Type=simple ExecStart=/usr/bin/notify-send "service %i failed"
It send a desktop notification (needs
libnotify
package and a notification server. To automate update every day crate a timer file~/.config/systemd/user/flatpak-update.timer
[Unit] Description=Update flatpak applications on boot [Timer] OnCalendar=daily Persistent=true [Install] WantedBy=timers.target
Then enable timer
$ systemctl --user daemon-reload $ systemctl --user enable --now flatpak-update.timer
-
Theming
When using window manager, there is no theming engine, and all GUI applications launch as default theme. I don't need all applications have consistant theming, but I do want them using dark theme instead of default light theme. For GTK applications add
GTK_THEME=Adwaita:dark
to environment variable, also create~/.config/settings.ini
then follow this guide set up a basic configuration. For Qt application using Adwaita-dark theme feels odd, I prefer using Breeze dark theme, but there is no easy way to specify the theme. So I copied~/.config/kdeglobals
from another machine with Breeze-dark theme, then setQT_QPA_PLATFORMTHEME=kde
. The config filessettings.ini
andkdeglobals
could be backup using this method, so you only need to set up once.
This repository has been archived by the owner on Mar 12, 2023. It is now read-only.