Dotfiles for macOS and Linux.
Run archinstall
in the live CD. I choose the i3
preset.
When prompted, I use this list of starter packages:
vim tmux htop firefox wpa_supplicant man-db networkmanager network-manager-applet dex xss-lock git
On my 2013 MacBook Air, I also get broadcom-wl
for wireless drivers.
Enable multilib packages:
$ sudo vim /etc/pacman.conf
[multilib]
Include = /etc/pacman.d/mirrorlist
$ sudo pacman -Syu
Install yay
:
$ git clone https://aur.archlinux.org/yay-bin.git
$ cd yay-bin
$ makepkg -si
Install st
:
$ git clone https://github.com/tvararu/st.git
$ cd st
$ sudo make install
$ yay -S libxft-bgra
Install dmenu
:
$ git clone https://github.com/tvararu/dmenu.git
$ cd dmenu
$ make
$ sudo make install
Install i3status
:
$ yay -S autoconf libconfuse-dev libyajl-dev libasound2-dev libiw-dev \
asciidoc libpulse-dev libnl-genl-3-dev meson
$ git clone https://github.com/tvararu/i3status.git
$ cd i3status
$ mkdir build
$ cd build
$ meson ..
$ ninja
$ sudo ninja install
Install fish
:
$ yay -S fish
$ chsh -s $(which fish)
$ fish
$ rm -r .bash*
Then:
$ cd
$ git clone https://github.com/tvararu/.dotfiles.git
$ mkdir .ssh .vim .gnupg
$ mkdir -p .local/share .local/bin
$ touch .Xresources.local
$ cd .dotfiles
$ ./arch.sh
$ stow --adopt */ # Replaces all existing dotfiles with symlinks to this repo
$ git reset --hard # Updates local dotfiles to be the same as in this repo
$ stow --restow --ignore=".theme.*" */ # Installs remaining dotfiles
$ ./macos.sh
After first-booting on my laptop:
$ sudo modprobe wl
$ sudo systemctl enable --now NetworkManager.service
$ nmtui
$ mkdir /mnt/SD
$ sudo vim /etc/fstab
UUID=<get using blkid> /mnt/SD exfat defaults,uid=1000 0 2
$ sudo systemctl enable --now syncthing@$USER.service
$ open http://127.0.0.1:8384
$ yay -S acpilight
$ sudo gpasswd -a $USER video
Firefox and other apps tear the screen when scrolling or otherwise changing large sections of the screen. Bumping the refresh rate from the default 60Hz and enabling FreeSync fixes it:
$ xrandr --rate 100
$ xrandr --output DisplayPort-0 --set TearFree on
To persist past restart:
$ cvt 3440 1440 100.00 # Generate modeline
$ xrandr --verbose -q # Or extract it like this
$ sudo vim /etc/X11/xorg.conf.d/10-monitor.conf
Section "Device"
Identifier "AMD"
Driver "amdgpu"
Option "TearFree" "true"
Option "VariableRefresh" "true"
EndSection
Section "Monitor"
Identifier "DisplayPort-0"
Option "Primary" "true"
Modeline "3440x1440_100.00" 543.50 3440 3488 3552 3600 1440 1443 1453 1510 -hsync +vsync
Option "PreferredMode" "3440x1440_100.00"
EndSection
Auto power-on after boot:
$ sudo vim /etc/bluetooth/main.conf # Scroll to end
[Policy]
AutoEnable=true
$ sudo systemctl enable --now bluetooth.service
Use bluetoothctl
to detect, pair, trust, and connect to peripherals:
$ bluetoothctl
> power on
> paired-devices
Device 04:4B:ED:E4:56:A2 Theodor’s Keyboard
Device DA:3C:8B:06:59:70 MX Master
> scan on
> trust <mac>
> pair <mac>
> connect <mac>
When connecting to the Apple keyboard, you need to type in a pairing code. Without a second keyboard, you can use onboard
as an on-screen keyboard.
After installing logiops-git
:
$ sudo vim /etc/logid.cfg
devices: ({
name: "Wireless Mouse MX Master";
hiresscroll: { hires: true; invert: true; target: false; };
});
$ systemctl enable --now logid.service
To change the overall keyboard layout to the one for an Apple ISO UK keyboard:
$ sudo localectl --no-convert set-x11-keymap gb apple mac
Use the system user instead of transmission
:
$ sudo systemctl edit transmission.service
[Service]
User=deity
To start now and on startup:
$ sudo systemctl enable --now transmission.service
$ sudo systemctl enable --now auto-cpufreq
To automatically set the correct timezone when connecting to a new network:
$ sudo vim /etc/NetworkManager/dispatcher.d/09-timezone
#!/bin/sh
case "$2" in
up)
timedatectl set-timezone "$(curl --fail https://ipapi.co/timezone)"
;;
esac
$ sudo vim /etc/security/faillock.conf
deny = 100
$ sudo vim /etc/X11/xorg.conf.d/10-monitor.conf
Section "ServerFlags"
Option "StandbyTime" "60"
Option "SuspendTime" "60"
Option "OffTime" "60"
Option "BlankTime" "60"
EndSection
$ echo "Xft.dpi: 192" >> .Xresources.local
$ echo "*.font: monospace:size=11" >> .Xresources.local
Restrict enrolling to the current user:
polkit.addRule(function (action, subject) {
if (action.id == "net.reactivated.fprint.device.enroll") {
return subject.user == "deity" ? polkit.Result.YES : polkit.Result.NO
}
})
Enroll the finger:
$ fprintd-enroll deity
Modify /etc/pam.d/{system-local-login,lightdm,sudo,i3lock}
by adding this
at the top:
auth sufficient pam_unix.so try_first_pass likeauth nullok
auth sufficient pam_fprintd.so
$ sudo vim /etc/acpi/events/stop-music-when-headphones-unplug
event=jack/headphone HEADPHONE unplug
action=su - USER -c "env DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus playerctl pause"
$ sudo systemctl enable --now acpid
Public domain.