Compare commits
9 Commits
02cc4698dc
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6953e4f8a2 | ||
|
|
12d9019278 | ||
|
|
d5e87dba70 | ||
|
|
a2cecfe691 | ||
|
|
ac1005b842 | ||
|
|
9fd1ba70a3 | ||
|
|
5d125be800 | ||
|
|
d1a43f0ff9 | ||
|
|
eea43ae978 |
@@ -13,6 +13,8 @@ export VISUAL=kak
|
|||||||
export BROWSER=firefox
|
export BROWSER=firefox
|
||||||
export TERMINAL=foot
|
export TERMINAL=foot
|
||||||
|
|
||||||
|
export PI_OFFLINE=1
|
||||||
|
|
||||||
# if running bash
|
# if running bash
|
||||||
if [ -n "$BASH_VERSION" ]; then
|
if [ -n "$BASH_VERSION" ]; then
|
||||||
# include .bashrc if it exists
|
# include .bashrc if it exists
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
],
|
],
|
||||||
"index_files": true,
|
"index_files": true,
|
||||||
// "color_scheme": "gruvbox (Light) (Soft).sublime-color-scheme",
|
// "color_scheme": "gruvbox (Light) (Soft).sublime-color-scheme",
|
||||||
"font_size": 11,
|
"font_size": 10,
|
||||||
"font_face": "Cascadia Code",
|
"font_face": "Cascadia Code",
|
||||||
"theme": "Adaptive.sublime-theme",
|
"theme": "Adaptive.sublime-theme",
|
||||||
"folder_exclude_patterns": ["external", ".svn", ".git", ".hg", "CVS", ".Trash", ".Trash-*"],
|
"folder_exclude_patterns": ["external", ".svn", ".git", ".hg", "CVS", ".Trash", ".Trash-*"],
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"shell_cmd": "build.bat",
|
"shell_cmd": "bash build.sh",
|
||||||
"file_regex": "^(.*)\\((\\d+),?(\\d+)?\\)\\s?:\\s([^\n]+)", // msvc
|
"file_regex": "^(.*)\\((\\d+),?(\\d+)?\\)\\s?:\\s([^\n]+)", // msvc
|
||||||
// "file_regex": "^(.*):(\\d+):(\\d+):", // clang
|
// "file_regex": "^(.*):(\\d+):(\\d+):", // clang
|
||||||
"working_dir": "$folder",
|
"working_dir": "$folder",
|
||||||
|
|||||||
@@ -232,13 +232,13 @@ bindsym $mod+r mode "resize"
|
|||||||
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-; pkill -USR1 -f "$HOME/.config/sway/status.sh"
|
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-; pkill -USR1 -f "$HOME/.config/sway/status.sh"
|
||||||
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+; pkill -USR1 -f "$HOME/.config/sway/status.sh"
|
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+; pkill -USR1 -f "$HOME/.config/sway/status.sh"
|
||||||
# Special key to take a screenshot with grim
|
# Special key to take a screenshot with grim
|
||||||
bindsym Print exec sh -c 'mkdir -p ~/screenshots; f=~/screenshots/$(date +%F-%H%M%S).png; grim "$f"; wl-copy < "$f"'
|
bindsym Print exec sh -c 'mkdir -p ~/screenshots; f=~/Pictures/$(date +%F-%H%M%S).png; grim "$f"; wl-copy < "$f"'
|
||||||
bindsym Shift+Print exec sh -c 'mkdir -p ~/screenshots; f=~/screenshots/$(date +%F-%H%M%S).png; grim -g "$(slurp)" "$f"; wl-copy < "$f"'
|
bindsym Shift+Print exec sh -c 'mkdir -p ~/screenshots; f=~/Pictures/$(date +%F-%H%M%S).png; grim -g "$(slurp)" "$f"; wl-copy < "$f"'
|
||||||
|
|
||||||
# Push-to-talk: hold Caps Lock to record, release to transcribe.
|
# Push-to-talk: hold Caps Lock to record, release to transcribe.
|
||||||
# xkb_options caps:none above disables the normal Caps Lock toggle, so bind by keycode.
|
# xkb_options caps:none above disables the normal Caps Lock toggle, so bind by keycode.
|
||||||
bindcode 66 exec sh -c 'voxtype record start; pkill -USR1 -f "$HOME/.config/sway/status.sh"'
|
# bindcode 66 exec sh -c 'voxtype record start; pkill -USR1 -f "$HOME/.config/sway/status.sh"'
|
||||||
bindcode --release 66 exec sh -c 'voxtype record stop; pkill -USR1 -f "$HOME/.config/sway/status.sh"'
|
# bindcode --release 66 exec sh -c 'voxtype record stop; pkill -USR1 -f "$HOME/.config/sway/status.sh"'
|
||||||
|
|
||||||
#
|
#
|
||||||
# Status Bar:
|
# Status Bar:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
print_status() {
|
print_status() {
|
||||||
volume_info=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ 2>/dev/null)
|
volume_info=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ 2>/dev/null)
|
||||||
@@ -7,21 +7,28 @@ print_status() {
|
|||||||
|
|
||||||
brightness=$(brightnessctl -m 2>/dev/null | awk -F, '{print $4}')
|
brightness=$(brightnessctl -m 2>/dev/null | awk -F, '{print $4}')
|
||||||
|
|
||||||
voxtype_state=$(voxtype status 2>/dev/null)
|
battery_device=$(upower -e 2>/dev/null | grep -m 1 battery)
|
||||||
case "$voxtype_state" in
|
if [ -n "$battery_device" ]; then
|
||||||
recording) voxtype=' | VOX REC' ;;
|
battery=$(upower -i "$battery_device" 2>/dev/null | awk '
|
||||||
transcribing) voxtype=' | VOX ...' ;;
|
/state/ { state=$2 }
|
||||||
*) voxtype='' ;;
|
/percentage/ { percentage=$2 }
|
||||||
esac
|
END {
|
||||||
|
if (percentage != "") {
|
||||||
|
printf "%s", percentage
|
||||||
|
if (state != "") printf " %s", state
|
||||||
|
}
|
||||||
|
}
|
||||||
|
')
|
||||||
|
fi
|
||||||
|
|
||||||
printf 'VOL %s | BRI %s%s | %s\n' "${volume:-n/a}" "${brightness:-n/a}" "$voxtype" "$(date +'%Y-%m-%d %H:%M:%S')"
|
printf 'VOL %s | BRI %s | BAT %s | %s\n' "${volume:-n/a}" "${brightness:-n/a}" "${battery:-n/a}" "$(date +'%Y-%m-%d %H:%M:%S')"
|
||||||
}
|
}
|
||||||
|
|
||||||
trap print_status USR1
|
trap print_status USR1
|
||||||
|
|
||||||
print_status
|
print_status
|
||||||
while :; do
|
while :; do
|
||||||
sleep 1 &
|
sleep 60 &
|
||||||
wait $!
|
wait $!
|
||||||
print_status
|
print_status
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
# ~/.config/tmux/tmux.conf
|
# ~/.config/tmux/tmux.conf
|
||||||
|
|
||||||
# Enable extended key reporting for terminals/apps that support it.
|
# Enable extended key reporting for terminals/apps that support it.
|
||||||
# set -g extended-keys on
|
set -g extended-keys on
|
||||||
# set -g extended-keys-format csi-u
|
set -g extended-keys-format csi-u
|
||||||
|
|
||||||
|
# To fix ctrl-b + direction (hjkl) switching pane multiple times after hitting the direction again
|
||||||
|
set-option -g repeat-time 150
|
||||||
|
|
||||||
# Index windows/tabs and panes from 1 instead of 0.
|
# Index windows/tabs and panes from 1 instead of 0.
|
||||||
set -g base-index 1
|
set -g base-index 1
|
||||||
|
|||||||
307
arch-install.md
307
arch-install.md
@@ -1,307 +0,0 @@
|
|||||||
# Arch install notes
|
|
||||||
|
|
||||||
## 1. Install the base system
|
|
||||||
|
|
||||||
These packages are needed before the first boot. Install them with `pacstrap` after mounting the target system at `/mnt` and the EFI system partition at `/mnt/boot`.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
base_packages=(
|
|
||||||
base # Minimal Arch system
|
|
||||||
linux # Linux kernel
|
|
||||||
linux-firmware
|
|
||||||
amd-ucode # AMD CPU microcode updates loaded by the boot loader
|
|
||||||
sudo # Run commands as root from the user account
|
|
||||||
git # Version control and cloning dotfiles
|
|
||||||
which
|
|
||||||
base-devel
|
|
||||||
)
|
|
||||||
|
|
||||||
pacstrap -K /mnt "${base_packages[@]}"
|
|
||||||
```
|
|
||||||
|
|
||||||
Generate `fstab`, then enter the installed system:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
genfstab -U /mnt >>/mnt/etc/fstab
|
|
||||||
arch-chroot /mnt
|
|
||||||
```
|
|
||||||
|
|
||||||
From inside the chroot, the scripted version of the remaining setup is:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
/path/to/dotfiles/arch-chroot-setup.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
The sections below show what the script does, following the same order as the Arch install guide: timezone, localization, boot loader, user, networking, packages, then reboot.
|
|
||||||
|
|
||||||
## 2. Configure timezone and localization
|
|
||||||
|
|
||||||
Set the timezone to Warsaw and sync the hardware clock:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
ln -sf /usr/share/zoneinfo/Europe/Warsaw /etc/localtime
|
|
||||||
hwclock --systohc
|
|
||||||
```
|
|
||||||
|
|
||||||
Enable English and Polish UTF-8 locales:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
sed -i 's/^#\(en_US.UTF-8 UTF-8\)/\1/' /etc/locale.gen
|
|
||||||
sed -i 's/^#\(pl_PL.UTF-8 UTF-8\)/\1/' /etc/locale.gen
|
|
||||||
locale-gen
|
|
||||||
```
|
|
||||||
|
|
||||||
Use English as the system language:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cat >/etc/locale.conf <<'EOF'
|
|
||||||
LANG=en_US.UTF-8
|
|
||||||
EOF
|
|
||||||
```
|
|
||||||
|
|
||||||
Use a Polish console keymap:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cat >/etc/vconsole.conf <<'EOF'
|
|
||||||
KEYMAP=pl2
|
|
||||||
EOF
|
|
||||||
```
|
|
||||||
|
|
||||||
## 3. Configure systemd-boot
|
|
||||||
|
|
||||||
These commands run inside `arch-chroot /mnt`. They assume the EFI system partition is mounted at `/boot` inside the chroot.
|
|
||||||
|
|
||||||
Install systemd-boot:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
bootctl install
|
|
||||||
```
|
|
||||||
|
|
||||||
Configure the loader menu. `timeout 0` makes boot faster by hiding the menu unless you hold the boot menu key.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cat >/boot/loader/loader.conf <<'EOF'
|
|
||||||
default arch.conf
|
|
||||||
timeout 0
|
|
||||||
console-mode max
|
|
||||||
editor no
|
|
||||||
EOF
|
|
||||||
```
|
|
||||||
|
|
||||||
Find the root filesystem UUID:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
blkid
|
|
||||||
```
|
|
||||||
|
|
||||||
Create the Arch boot entry. Replace `ROOT_UUID_HERE` with the UUID of the root partition, not the EFI partition.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cat >/boot/loader/entries/arch.conf <<'EOF'
|
|
||||||
title Arch Linux
|
|
||||||
linux /vmlinuz-linux
|
|
||||||
initrd /amd-ucode.img
|
|
||||||
initrd /initramfs-linux.img
|
|
||||||
options root=UUID=ROOT_UUID_HERE rw
|
|
||||||
EOF
|
|
||||||
```
|
|
||||||
|
|
||||||
Verify the boot loader configuration:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
bootctl status
|
|
||||||
```
|
|
||||||
|
|
||||||
## 4. Create the user account
|
|
||||||
|
|
||||||
Create the normal user and add it to the `wheel` group so it can use `sudo`.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
useradd -m -s /bin/bash -G wheel,video,render kk
|
|
||||||
passwd kk
|
|
||||||
```
|
|
||||||
|
|
||||||
Enable `sudo` for the `wheel` group:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
EDITOR=vi visudo
|
|
||||||
```
|
|
||||||
|
|
||||||
Uncomment this line:
|
|
||||||
|
|
||||||
```sudoers
|
|
||||||
%wheel ALL=(ALL:ALL) ALL
|
|
||||||
```
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
|
|
||||||
- `-m` creates `/home/kk`.
|
|
||||||
- `-s /bin/bash` sets Bash as the login shell.
|
|
||||||
- `-G wheel,video,render` adds the user to `sudo` plus the groups often needed by Sway/GPU access.
|
|
||||||
|
|
||||||
## 5. Enable ethernet networking
|
|
||||||
|
|
||||||
Enable `systemd-networkd` and `systemd-resolved`:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
systemctl enable systemd-networkd.service
|
|
||||||
systemctl enable systemd-resolved.service
|
|
||||||
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
|
|
||||||
```
|
|
||||||
|
|
||||||
Use the packaged ethernet DHCP example config:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
ln -s /usr/lib/systemd/network/89-ethernet.network.example /etc/systemd/network/89-ethernet.network
|
|
||||||
```
|
|
||||||
|
|
||||||
This is enough for a normal wired connection using DHCP.
|
|
||||||
|
|
||||||
## 6. Install core tools
|
|
||||||
|
|
||||||
These are the day-to-day terminal and development tools.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
core_packages=(
|
|
||||||
tmux # Terminal multiplexer
|
|
||||||
kakoune # Text editor
|
|
||||||
man-db # Manual page database
|
|
||||||
man-pages # Linux and POSIX manual pages
|
|
||||||
clang # C/C++ compiler toolchain
|
|
||||||
make # Build automation tool
|
|
||||||
tcc # Tiny C compiler
|
|
||||||
ripgrep # Fast grep replacement, command: rg
|
|
||||||
curl # Download URLs from the command line
|
|
||||||
plocate # Fast file name search database
|
|
||||||
fzf # Fuzzy finder for terminal scripts and navigation
|
|
||||||
gdb # Debugger
|
|
||||||
)
|
|
||||||
|
|
||||||
pacman -Syu --needed "${core_packages[@]}"
|
|
||||||
```
|
|
||||||
|
|
||||||
Initialize the `plocate` database:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
updatedb
|
|
||||||
```
|
|
||||||
|
|
||||||
## 7. Install networking and remote file tools
|
|
||||||
|
|
||||||
```sh
|
|
||||||
network_packages=(
|
|
||||||
openssh # SSH client/server tools
|
|
||||||
sshfs # Mount remote machines over SSH
|
|
||||||
)
|
|
||||||
|
|
||||||
pacman -S --needed "${network_packages[@]}"
|
|
||||||
```
|
|
||||||
|
|
||||||
## 8. Install the Sway desktop
|
|
||||||
|
|
||||||
```sh
|
|
||||||
desktop_packages=(
|
|
||||||
sway # Wayland window manager
|
|
||||||
swayidle # Idle actions like lock, suspend, hibernate
|
|
||||||
swaybg # Wallpaper setter for Sway
|
|
||||||
swaylock # Screen locker for Sway/Wayland
|
|
||||||
foot # Wayland terminal emulator
|
|
||||||
wmenu # Lightweight Wayland launcher/menu
|
|
||||||
xorg-xwayland # Run X11 applications inside Wayland
|
|
||||||
wl-clipboard # wl-copy and wl-paste clipboard tools
|
|
||||||
xdg-desktop-portal-wlr # Portal backend for screen sharing and app integration
|
|
||||||
xdg-user-dirs # Standard folders like Downloads, Documents, Pictures
|
|
||||||
grim # Wayland screenshot tool
|
|
||||||
)
|
|
||||||
|
|
||||||
pacman -S --needed "${desktop_packages[@]}"
|
|
||||||
```
|
|
||||||
|
|
||||||
## 9. Install audio and media tools
|
|
||||||
|
|
||||||
```sh
|
|
||||||
media_packages=(
|
|
||||||
pipewire # Modern Linux audio/media server
|
|
||||||
pipewire-pulse # PulseAudio compatibility for PipeWire
|
|
||||||
pipewire-alsa # ALSA compatibility for PipeWire
|
|
||||||
pipewire-jack # JACK compatibility for PipeWire
|
|
||||||
wireplumber # PipeWire session and policy manager
|
|
||||||
pavucontrol # Graphical volume mixer
|
|
||||||
ffmpeg # Video/audio codecs and conversion tools
|
|
||||||
imv # Image viewer
|
|
||||||
mpv # Video/audio player
|
|
||||||
)
|
|
||||||
|
|
||||||
pacman -S --needed "${media_packages[@]}"
|
|
||||||
```
|
|
||||||
|
|
||||||
## 10. Install fonts
|
|
||||||
|
|
||||||
```sh
|
|
||||||
font_packages=(
|
|
||||||
ttf-fira-code # Monospace programming font with ligatures
|
|
||||||
noto-fonts # Broad Unicode font coverage
|
|
||||||
noto-fonts-cjk # Chinese, Japanese, and Korean font coverage
|
|
||||||
noto-fonts-emoji # Emoji font support
|
|
||||||
noto-fonts-extra # Extra Noto font families
|
|
||||||
ttf-liberation # Microsoft-compatible replacement fonts
|
|
||||||
ttf-dejavu # General purpose readable fonts
|
|
||||||
ttf-roboto # Roboto font family
|
|
||||||
)
|
|
||||||
|
|
||||||
pacman -S --needed "${font_packages[@]}"
|
|
||||||
```
|
|
||||||
|
|
||||||
## 11. Install browser and extra tools
|
|
||||||
|
|
||||||
```sh
|
|
||||||
app_packages=(
|
|
||||||
firefox # Web browser
|
|
||||||
)
|
|
||||||
|
|
||||||
pacman -S --needed "${app_packages[@]}"
|
|
||||||
```
|
|
||||||
|
|
||||||
Install `opencode` separately if it is available from an AUR helper or a custom repository on the installed system.
|
|
||||||
|
|
||||||
## 12. Install NVIDIA driver
|
|
||||||
|
|
||||||
Install the open NVIDIA kernel driver for the PC graphics card:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
pacman -S --needed nvidia-open
|
|
||||||
```
|
|
||||||
|
|
||||||
Reboot after leaving the chroot so the driver is loaded on the first real boot.
|
|
||||||
|
|
||||||
## 13. Reboot into the installed system
|
|
||||||
|
|
||||||
Exit the chroot, unmount everything, and reboot:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
exit
|
|
||||||
umount -R /mnt
|
|
||||||
reboot
|
|
||||||
```
|
|
||||||
|
|
||||||
Log in as `kk` after rebooting.
|
|
||||||
|
|
||||||
## 14. First login tasks
|
|
||||||
|
|
||||||
Create standard user directories:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
xdg-user-dirs-update
|
|
||||||
```
|
|
||||||
|
|
||||||
Enable the PipeWire user services:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
systemctl --user enable --now pipewire pipewire-pulse wireplumber
|
|
||||||
```
|
|
||||||
|
|
||||||
Generate a local SSH key for this machine:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519
|
|
||||||
```
|
|
||||||
170
arch-install.sh
Executable file
170
arch-install.sh
Executable file
@@ -0,0 +1,170 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
username=kk
|
||||||
|
|
||||||
|
core_packages=(
|
||||||
|
tmux
|
||||||
|
kakoune
|
||||||
|
man-db
|
||||||
|
man-pages
|
||||||
|
clang
|
||||||
|
make
|
||||||
|
cmake
|
||||||
|
tcc
|
||||||
|
ripgrep
|
||||||
|
curl
|
||||||
|
plocate
|
||||||
|
fzf
|
||||||
|
gdb
|
||||||
|
which
|
||||||
|
tree
|
||||||
|
)
|
||||||
|
|
||||||
|
network_packages=(
|
||||||
|
openssh
|
||||||
|
sshfs
|
||||||
|
)
|
||||||
|
|
||||||
|
desktop_packages=(
|
||||||
|
sway
|
||||||
|
swayidle
|
||||||
|
swaybg
|
||||||
|
swaylock
|
||||||
|
foot
|
||||||
|
wmenu
|
||||||
|
polkit # this is needed to fix swayidle not being to suspend because it doesn't have the authority, systemd-logind asks it for policy
|
||||||
|
xorg-xwayland
|
||||||
|
wl-clipboard
|
||||||
|
xdg-desktop-portal-wlr
|
||||||
|
xdg-desktop-portal-gtk
|
||||||
|
xdg-user-dirs
|
||||||
|
xdg-utils
|
||||||
|
grim # For screenshotting the desktop
|
||||||
|
upower # For querying battery charge
|
||||||
|
)
|
||||||
|
|
||||||
|
media_packages=(
|
||||||
|
pipewire
|
||||||
|
pipewire-pulse
|
||||||
|
pipewire-alsa
|
||||||
|
pipewire-jack
|
||||||
|
pipewire-libcamera
|
||||||
|
libcamera
|
||||||
|
pavucontrol
|
||||||
|
wireplumber
|
||||||
|
bluez
|
||||||
|
bluez-utils # bluetooth
|
||||||
|
rtkit # There was a pipewire error so I decided to add this, "changes scheduling policy of user threads to realtime"
|
||||||
|
ffmpeg
|
||||||
|
imv
|
||||||
|
mpv
|
||||||
|
)
|
||||||
|
|
||||||
|
font_packages=(
|
||||||
|
ttf-fira-code
|
||||||
|
ttf-jetbrains-mono
|
||||||
|
noto-fonts
|
||||||
|
noto-fonts-cjk
|
||||||
|
noto-fonts-emoji
|
||||||
|
noto-fonts-extra
|
||||||
|
ttf-liberation
|
||||||
|
ttf-dejavu
|
||||||
|
ttf-roboto
|
||||||
|
fontconfig
|
||||||
|
)
|
||||||
|
|
||||||
|
app_packages=(
|
||||||
|
firefox
|
||||||
|
)
|
||||||
|
|
||||||
|
machine_packages=(
|
||||||
|
nvidia-open
|
||||||
|
)
|
||||||
|
|
||||||
|
if [[ ${EUID} -ne 0 ]]; then
|
||||||
|
printf 'Run this script as root inside arch-chroot.\n' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ln -sf /usr/share/zoneinfo/Europe/Warsaw /etc/localtime
|
||||||
|
hwclock --systohc
|
||||||
|
|
||||||
|
sed -i 's/^#\(en_US.UTF-8 UTF-8\)/\1/' /etc/locale.gen
|
||||||
|
sed -i 's/^#\(pl_PL.UTF-8 UTF-8\)/\1/' /etc/locale.gen
|
||||||
|
locale-gen
|
||||||
|
|
||||||
|
cat >/etc/locale.conf <<'EOF'
|
||||||
|
LANG=en_US.UTF-8
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat >/etc/vconsole.conf <<'EOF'
|
||||||
|
KEYMAP=pl2
|
||||||
|
EOF
|
||||||
|
|
||||||
|
bootctl install
|
||||||
|
|
||||||
|
cat >/boot/loader/loader.conf <<'EOF'
|
||||||
|
default arch.conf
|
||||||
|
timeout 0
|
||||||
|
console-mode max
|
||||||
|
editor no
|
||||||
|
EOF
|
||||||
|
|
||||||
|
root_uuid=$(findmnt -no UUID /)
|
||||||
|
if [[ -z ${root_uuid} ]]; then
|
||||||
|
printf 'Could not detect root filesystem UUID. Check findmnt/blkid manually.\n' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat >/boot/loader/entries/arch.conf <<EOF
|
||||||
|
title Arch Linux
|
||||||
|
linux /vmlinuz-linux
|
||||||
|
initrd /amd-ucode.img
|
||||||
|
initrd /initramfs-linux.img
|
||||||
|
options root=UUID=${root_uuid} rw
|
||||||
|
EOF
|
||||||
|
|
||||||
|
bootctl status
|
||||||
|
|
||||||
|
systemctl enable systemd-networkd.service
|
||||||
|
systemctl enable systemd-resolved.service
|
||||||
|
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
|
||||||
|
install -d /etc/systemd/network
|
||||||
|
ln -sf /usr/lib/systemd/network/89-ethernet.network.example /etc/systemd/network/89-ethernet.network
|
||||||
|
|
||||||
|
if ! id -u "${username}" >/dev/null 2>&1; then
|
||||||
|
useradd -m -s /bin/bash -G wheel,video,render "${username}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
install -m 0750 -d /etc/sudoers.d
|
||||||
|
cat >/etc/sudoers.d/00-wheel <<'EOF'
|
||||||
|
%wheel ALL=(ALL:ALL) ALL
|
||||||
|
EOF
|
||||||
|
chmod 0440 /etc/sudoers.d/00-wheel
|
||||||
|
visudo -cf /etc/sudoers.d/00-wheel
|
||||||
|
|
||||||
|
passwd "${username}"
|
||||||
|
|
||||||
|
curl -O https://download.sublimetext.com/sublimehq-pub.gpg && pacman-key --add sublimehq-pub.gpg && pacman-key --lsign-key 8A8F901A && rm sublimehq-pub.gpg
|
||||||
|
echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/stable/x86_64" | sudo tee -a /etc/pacman.conf
|
||||||
|
|
||||||
|
pacman -Syu --needed \
|
||||||
|
"${core_packages[@]}" \
|
||||||
|
"${network_packages[@]}" \
|
||||||
|
"${desktop_packages[@]}" \
|
||||||
|
"${media_packages[@]}" \
|
||||||
|
"${font_packages[@]}" \
|
||||||
|
"${app_packages[@]}" \
|
||||||
|
"${machine_packages[@]}" \
|
||||||
|
sublime-merge sublime-text
|
||||||
|
|
||||||
|
updatedb
|
||||||
|
systemctl enable sshd.service
|
||||||
|
systemctl enable rtkit-daemon.service
|
||||||
|
systemctl enable --now bluetooth.service
|
||||||
|
|
||||||
|
printf '\nChroot setup complete. Exit, unmount /mnt, reboot, then log in as %s.\n' "${username}"
|
||||||
|
printf 'After first login, run: xdg-user-dirs-update\n'
|
||||||
|
printf 'After first login, run: systemctl --user enable --now pipewire pipewire-pulse wireplumber\n'
|
||||||
|
printf 'Generate SSH key after first login with: ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519\n'
|
||||||
1125
bin/json.c
Executable file
1125
bin/json.c
Executable file
File diff suppressed because it is too large
Load Diff
7
bin/tmux3
Executable file
7
bin/tmux3
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
tmux split-window -h \; \
|
||||||
|
split-window -h \; \
|
||||||
|
select-layout even-horizontal \; \
|
||||||
|
resize-pane -t 1 -R "${1:-5}"
|
||||||
@@ -1,356 +0,0 @@
|
|||||||
# 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
|
|
||||||
|
|
||||||
- [x] systemd-boot
|
|
||||||
- [x] systemd-network + iwd
|
|
||||||
|
|
||||||
### 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 \
|
|
||||||
pipewire-jack \
|
|
||||||
wireplumber \
|
|
||||||
pavucontrol \
|
|
||||||
grim \
|
|
||||||
imv \
|
|
||||||
mpv \
|
|
||||||
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.
|
|
||||||
- `imv` - image viewer
|
|
||||||
- `mpv` - multimedia viewer (watching videos)
|
|
||||||
- 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
|
|
||||||
```
|
|
||||||
|
|
||||||
7
setup.sh
7
setup.sh
@@ -1,6 +1,9 @@
|
|||||||
SRC=$HOME/dotfiles
|
SRC=$HOME/dotfiles
|
||||||
rm $HOME/.bashrc
|
[ -e $HOME/.bashrc ] && echo "I won't install ~/.bashrc because there is already a file like that; skipping setup for this file."
|
||||||
rm $HOME/.bash_profile
|
[ -e $HOME/.vimrc ] && echo "I won't install ~/.vimrc because there is already a file like that; skipping setup for this file."
|
||||||
|
[ -e $HOME/.bash_profile ] && echo "I won't install ~/.bash_profile because there is already a file like that; skipping setup for this file."
|
||||||
|
[ -d $HOME/.config ] && echo "I won't install ~/.config because there is already a directory like that; skipping setup for this directory."
|
||||||
|
[ -d $HOME/bin ] && echo "I won't install ~/bin because there is already a directory like that; skipping setup for this directory."
|
||||||
ln -sf $SRC/.bashrc $HOME/.bashrc
|
ln -sf $SRC/.bashrc $HOME/.bashrc
|
||||||
ln -sf $SRC/.vimrc $HOME/.vimrc
|
ln -sf $SRC/.vimrc $HOME/.vimrc
|
||||||
ln -sf $SRC/.bash_profile $HOME/.bash_profile
|
ln -sf $SRC/.bash_profile $HOME/.bash_profile
|
||||||
|
|||||||
Reference in New Issue
Block a user