# System install guide Install guide with DIY spirit, key is to reproduce my system setup while making sure understanding is there and all. - Commands are written for user `kk` unless stated otherwise. ## Current TODOs ### System / mounts - [x] Add server SSH keys and PC SSH keys - [ ] Mount the mobile phone - Make sure nobody else can log in when I connect to random Wi-Fi. - [ ] Mount `/proton` on startup - [x] Mount `/lenovo-laptop` - [x] Mount server at `/server-vps` ### Desktop / UX - [x] Hibernate if not using the PC for 10 minutes - [ ] Start Sway in a tmux session for debugging - [ ] Kakoune setup - [x] Firefox bookmarks - [ ] Ideas for Chinese learning integration ### Launcher / search - [x] Combine apps, scripts, bookmarks, and files - [x] Use `.desktop` file name instead of the `Name` parameter - [x] Everything relevant in `wmenu` browser - [x] `plocate + wmenu > xdg-open` - [x] Applications + `bin` folder - [x] Bookmarks ### Ideas looking for problems - [ ] tmux automation --- ## Bootstrap sudo and git ```sh su root export PATH="$PATH:/usr/sbin" apt install sudo git usermod -aG sudo kk ``` Then exit both root and the user session, and log in again so the `sudo` group change applies. Verify: ```sh groups # should see "sudo" sudo whoami # you should see "root" ``` Expected output from `sudo whoami`: ```text root ``` --- ## Install basic utilities **Automate later.** ```sh sudo apt update sudo apt install -y \ clang \ cmake \ build-essential \ make \ tcc \ vim \ ripgrep \ curl \ git \ man-db \ plocate \ tmux \ fzf \ dtrx \ gdb sudo updatedb # plocate update the database so you can query files on PC nicely ``` - fzf - fuzzy search on command line, good for making command line tools - ripgrep - better grep, nicer syntax and faster: rg "query" - dtrx - nice archive unpacking wrapper that makes it less confusing, just dtrx thing.zip or whatever other tar and it should work nicely Mostly development tools are downloaded here, stuff like tmux, vim and the compiler toolchain needed for development, compiling etc. --- ## Speed up GRUB boot **Automate later.** Edit `/etc/default/grub`: ```sh sudo vi /etc/default/grub ``` Set: ```ini GRUB_TIMEOUT=0 GRUB_TIMEOUT_STYLE=hidden ``` Apply changes: ```sh sudo update-grub ``` --- ## Enable Debian non-free repositories **Automate later.** Needed for NVIDIA and firmware packages. Edit `/etc/apt/sources.list` and add: ```text contrib non-free non-free-firmware ``` Then update apt: ```sh sudo apt update ``` --- ## Install drivers and firmware **Machine-specific / automate carefully.** ```sh sudo apt install -y \ nvidia-driver \ firmware-misc-nonfree \ linux-headers-amd64 ``` TODO: - Set NVIDIA modeset to `1`. - Update initramfs. - Reboot. --- ## Desktop environment: Sway **Automate later.** ```sh sudo apt install -y \ sway \ swayidle \ swaybg \ swaylock \ foot \ wmenu \ brightnessctl \ xwayland \ wl-clipboard \ xdg-desktop-portal-wlr \ xdg-desktop-portal-gtk \ xdg-user-dirs \ fonts-jetbrains-mono \ fonts-noto-cjk \ fonts-noto-cjk-extra \ pipewire \ pipewire-pulse \ pipewire-alsa \ wireplumber \ pavucontrol \ grim \ ffmpeg libavcodec-extra ``` Package notes: - sway, terminal, menu, addons: - `sway` - the Wayland window manager / desktop environment of choice. This is the main thing that replaces a traditional desktop like GNOME or KDE. - `swayidle` - idle manager for Sway. Used for things like locking the screen, turning off the display, suspending, or hibernating after a timeout. - `swaybg` - simple wallpaper/background setter for Sway. - `swaylock` - screen locker for Sway/Wayland. Used when locking the session manually or from `swayidle`. - `foot` - terminal emulator for Wayland. This is the main terminal. - `wmenu` - small menu/launcher for Wayland. Useful for app launching and custom scripts like bookmarks/search/file opening. - `grim` - screenshot tool for Wayland. Usually used together with selection/clipboard scripts later. - `brightnessctl` - command line tool for changing screen brightness, usually bound to laptop brightness keys. - `xwayland` - compatibility layer that allows older X11 applications to run inside the Wayland/Sway session. - `wl-clipboard` - Wayland clipboard tools, mainly `wl-copy` and `wl-paste`. Needed by scripts and editor integrations. - `fonts-jetbrains-mono` - nice monospace font for terminal/editor use. - xdg, a standard required by some apps (shared enviroment variables and such): - `xdg-desktop-portal-wlr` - desktop portal backend for wlroots compositors like Sway. Needed for screen sharing, screenshots, file pickers, and other app integrations. - `xdg-desktop-portal-gtk` - GTK portal backend/fallback. Helps with file picker dialogs and desktop integration for some applications. - `xdg-user-dirs` - creates standard user folders like `~/Downloads`, `~/Documents`, `~/Pictures`, etc. - fix unicode characters (like Chinese) not showing up properly in firefox: - `fonts-noto-cjk` - fonts needed for displaying Chinese, Japanese, Korean, etc. characters in Firefox, Chromium, terminal apps, and other programs. - `fonts-noto-cjk-extra` - additional CJK font coverage/styles. - audio: - `pipewire` - the main modern Linux audio/media server. Handles audio routing and is also useful for screen sharing/media integration on Wayland. - `pipewire-pulse` - PulseAudio compatibility layer for PipeWire. Makes applications that expect PulseAudio work through PipeWire instead. - `pipewire-alsa` - ALSA compatibility layer for PipeWire. Helps applications that use ALSA directly play/record audio through PipeWire. - `wireplumber` - PipeWire session/policy manager. It decides how audio devices and streams should be connected automatically. - `pavucontrol` - graphical volume mixer. Useful for choosing input/output devices, changing app volumes, and debugging audio problems. - codecs (to fix videos not playing in browser): - ffmpeg libavcodec-extra ### Fix Sway permission issues If Sway reports render/video permission errors, add the user to the relevant groups: ```sh sudo usermod -aG video,render kk ``` Log out and back in afterwards. --- ## SSH keys **Manual.** Generate a key if the machine does not already have one: ```sh ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N "" ``` Now exchange the keys with relevant machines so as to make communication easier. This prepares the ground for mounting these machines as easy to access drives. --- ## SSHFS drives **Partly manual.** Install SSHFS: ```sh sudo apt install -y sshfs ``` Create mount points as needed: ```sh sudo mkdir -p /server-vps /lenovo-laptop /proton ``` Example `/etc/fstab` entry for the VPS: ```fstab root@157.90.144.237:/ /server-vps fuse.sshfs noauto,x-systemd.automount,_netdev,x-systemd.idle-timeout=2min,x-systemd.mount-timeout=10s,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,IdentityFile=/home/kk/.ssh/id_ed25519,UserKnownHostsFile=/home/kk/.ssh/known_hosts,StrictHostKeyChecking=accept-new,allow_other,default_permissions 0 0 ``` Test after editing `/etc/fstab`: ```sh sudo systemctl daemon-reload ls /server-vps ``` --- ## Browser / internet tools **Automate later.** ```sh sudo apt install -y chromium ``` Optional text/web search tools: ```sh sudo apt install -y w3m surfraw ``` --- ## Extras ### Clipboard history ```sh sudo apt install -y cliphist ``` --- ## Voice typing: Voxtype **Manual / automate carefully.** Install Voxtype: ```sh curl -LO https://github.com/peteonrails/voxtype/releases/download/v0.6.0/voxtype_0.6.0-1_amd64.deb sudo dpkg -i voxtype_0.6.0-1_amd64.deb rm voxtype_0.6.0-1_amd64.deb ``` Install runtime dependencies: ```sh sudo apt install -y \ wtype \ wl-clipboard \ libnotify-bin \ playerctl ``` Allow input access: ```sh sudo usermod -aG input "$USER" ``` Log out and back in afterwards. ### Optional GPU support ```sh read -r -p "Enable GPU support? [y/N] " answer case "$answer" in [yY]|[yY][eE][sS]) sudo voxtype setup gpu --enable ;; esac ``` ### Voxtype setup ```sh voxtype setup voxtype setup systemd voxtype setup model ```