Skip to content

Instantly share code, notes, and snippets.

@ntfc
Last active May 24, 2021 08:10
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ntfc/5dd78a7dc6746c95f786 to your computer and use it in GitHub Desktop.
Save ntfc/5dd78a7dc6746c95f786 to your computer and use it in GitHub Desktop.
arch linux installation steps

TODO

  1. set M2_HOME if maven is installed (on zshrc)
  2. Encrypt dropbox
  3. powersave
  4. keyring (as in https://wiki.archlinux.org/index.php/GNOME/Keyring#PAM_method)
  5. stow more stuff like rofi

[TOC]

Install archlinux

Steps taken from here: dharmab/ansible-archlinux

These steps are for Intel CPU (Core 2 Duo) + Nvidia GPU

These steps are to be executed after disk partition, formatting and encryption.

To run these steps, we should be able to login to TTY as root, where the steps should then be executed.

Command prepended with # are executed with root privileges while $ denotes commands to executed as USER

network

Use dhcpcd $INTERFACE until a network manager is installed. If you're on wifi, use wifi-menu.

The command ip link show is similar to the old ifconfig

connman

# pacman -S connman wpa_supplicant
# systemctl enable connman.service
# systemctl start connman.service
# cat /etc/connman/main.conf
[General]
AllowHostnameUpdates = false
PreferredTechnologies = ethernet,wifi
SingleConnectedTechnology = true
NetworkInterfaceBlacklist=vmnet,vboxnet,virbr,ifb,docker,veth

locale

# locale -a
## uncomment `en_US.UTF-8 UTF8` and `pt_PT.UTF-8 UTF8`
# locale-gen
# cat /etc/locale.conf
LANG=en_US.UTF-8
LC_MONETARY=pt_PT.UTF-8

pacman

# pacman -S reflector
# reflector --country "Portugal" -l 200 -p http --sort rate --save # /etc/pacman.d/mirrorlist
# pacman -Syy
# pacman -Su --noconfirm

Enable multilib:

[multilib]
Include = /etc/pacman.d/mirrorlist

user

# useradd -m -g users -G wheel $USER
# passwd $USER

git

TODO: gitliasrc, GPG

# pacman -S git
$ git config --global user.name "$USERNAME"
$ git config --global user.email "$EMAIL"

stow

# pacman -S stow
$ cd ~ && git clone git@github.com:ntfc/dotfiles.git

devel

WikiArch articles: JRE fonts

# pacman -S base-devel gdb jdk7-openjdk jdk8-openjdk maven python python2
# archlinux-java set java-8-openjdk
# echo "_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on'" >> /etc/environment"
# stow -d ~/dotfiles -t /etc environment

TODO: JDK8 Infinality package

vim

# pacman -S gvim
$ stow -d ~/dotfiles -t ~/ vim
$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
$ vim +PluginUpdate +qall!

SEE: YouCompleteMe and vim-gitgutter

sudo

ArchWiki article: Sudo

# pacman -S sudo
# EDITOR=vim visudo

See: sudo sanity check

Add:

Cmnd_Alias POWER = /usr/bin/systemctl poweroff, /usr/bin/systemctl reboot, /usr/bin/systemctl suspend, /usr/bin/systemctl hibernate
Cmnd_Alias SERVICE = /usr/bin/systemctl status, /usr/bin/systemctl is-enabled

...
Defaults env_keep += "ftp_proxy http_proxy https_proxy no_proxy"
# use $env_editor as default editor, and vim/vi/nano as fallbacks
Defaults env_editor,editor=/usr/bin/vim:/usr/bin/vi:/usr/bin/nano
...
root ALL=(ALL) ALL
ntfc ALL=(ALL) ALL, NOPASSWD: POWER, NOPASSWD: SERVICE

aur

$ git clone https://aur.archlinux.org/package-query.git
$ cd package-query && makepkg -si --noconfirm && cd ../
$ git clone https://aur.archlinux.org/yaourt.git
$ cd yaourt && makepkg -si --noconfirm && cd ../
$ rm -rf package-query yaourt

utilities

pacman -S curl rsync ntp htop nmap wget openssh net-tools

Enable NTP

ArchWiki article: NTP

systemctl enable ntpd.service
systemctl start ntpd.service

Fonts

ArchWiki article: Fonts and Infinality

Add repository to pacman.conf:

[infinality-bundle]
Server = http://bohoomil.com/repo/$arch

Find the KEYID at ArchWiki

# pacman -S ttf-dejavu ttf-liberation ttf-droid ttf-inconsolata adobe-source-code-pro-fonts noto-fonts noto-fonts-emoji ttf-linux-libertine
# pacman-key -r $KEYID && pacman-key --lsign-key $KEYID && pacman -Syy
# pacman -S {fontconfig,freetype2}-infinality-ultimate

sysrq

Create /etc/sysctl.d/99-sysrq.conf with:

kernel.sysrq=1

xorg

ArchWiki article: Xorg

$ yaourt -S xorg xorg-server-utils nvidia-340xx

touchpad/keyboard

ArchWiki articles: libinput

NOTE: Use libinput instead of synaptics

# pacman -S xorg-xinput xf86-input-libinput
# stow -d ~/dotfiles -t / X11

tty resolution

ArchWiki articles: Uvesafb

  • Remove GRUB_GFXPAYLOAD_LINUX=keep from /etc/default/grub and re-generate grub.cfg
  • Install v86d: yaourt -S v86d
  • Add the v86d hook: HOOKS="base udev v86d ..."
  • Copy uvesafb.conf cp /usr/lib/modprobe.d/uvesafb.conf /etc/modprobe.d/uvesafb.conf
  • Set the proper resolution on uvesafb.conf:
options uvesafb mode_option=1366x768-32 scroll=ywrap
  • Add the conf file to mkinitcpio:
FILES="/etc/modprobe.d/uvesafb.conf"
  • mkinitcpio -p linux

hdmi hotpluggig

# stow -d ~/dotfiles -t / udev
# udevadm control --reload

openbox

$ yaourt -S openbox obconf obkey obapps wmctrl xorg-xprop xterm xfce4-panel xfce4-screenshooter xfce4-notifyd xfce4-session dmenu-xft-mouse-height-fuzzy-history zukitwo-themes file-roller xorg-xvinfo
$ stow -d ~/dotfiles/ -t ~/ openbox
$ wget http://openbox.org/dist/tools/setlayout.c
$ gcc -o ~/.config/openbox/setlayout setlayout.c -lX11
$ rm setlayout.c

gui

$ yaourt -S lightdm lightdm-gtk-greeter lxappearance xcursor-human arandr numlockx hicolor-icon-theme gnome-colors-icon-theme gnome-icon-theme-xfce lxinput
# systemctl enable lightdm.service
$ stow -d ~/dotfiles -t ~/ gtk3

Edit /etc/lightdm.conf:

greeter-session=lightdm-gtk-greeter
greeter-setup-script=/usr/bin/numlockx on

pulseaudio

$ yaourt -S pulseaudio pavucontrol pamixer pulseaudio-alsa lib32-libpulse lib32-alsa-plugins
$ cat /etc/modprobe.d/oss.conf
blacklist snd_pcm_oss
$ yaourt -S gst-plugins-good gstreamer0.10-good-plugins libao
$ cat /etc/libao.conf
default_driver=pulse
dev=default

browsers

$ yaourt -S firefox chromium chromium-widevine ffmpeg

TODO: firefox tweaks

screensaver

ArchWiki article: xscreensaver

$ yaourt -S xscreensaver-arch-logo # remove gdm from PKGBUILD
$ stow -d ~/dotfiles -t ~/ xscreensaver

icons

Install icons

$ stow -d ~/dotfiles -t ~/.local/share/icons icons

urxvt

$ yaourt -S rxvt-unicode-patched rxvt-unicode-terminfo
$ stow -d ~/dotfiles -t ~/ urxvt
$ echo "Urxvt*iconFile: /home/$USER/.local/share/icons/hicolor/128x128/apps/urxvt.png" > ~/.config/Xresources/urxvt-icon

bash & zsh

ArchWiki article: Zsh

$ yaourt -S zsh zsh-completions
$ sudo chsh -s /usr/bin/zsh
# sudo chsh -s /usr/bin/zsh
$ stow -d ~/dotfiles/ -t ~/ alias
$ git clone https://github.com/zsh-users/antigen ~/.zsh/antigen
$ stow -d ~/dotfiles/ -t ~/ zsh
$ stow -d ~/dotfiles/ -t ~/ bash
$ mkdir -p ~/.cache/zsh

tmux

$ yaourt -S tmux
$ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
$ stow -d ~/dotfiles -t ~/ tmux

startup

Even though lightdm is used, xinitrc is configured for instances where lightdm is unavailable.

$ stow -d ~/dotfiles/ -t ~/ startup
# stow -d ~/dotfiles -t /opt xdg-autostart

Edit /etc/lightdm.conf:

session-setup-script=/opt/remove-xdg-autostart

file explorer

$ yaourt -S thunar thunar-volman thunar-archive-plugin gvfs 

apps

yaourt -S feh viewnior dropbox cmst mousepad
yaourt -S keepass xdotool xsel xbindkeys volumeicon volnoti light

copyq

$ yaourt -S copyq
$ stow -d ~/dotfiles/ -t ~/ copyq

acpi

$ yaourt -S acpid
# stow -d ~/dotfiles -t / logind
# systemctl restart systemd-logind.service

Edit /etc/acpi/events/anything (replace $USER with main non-root user):

# Pass all events to our one handler script
event=.*
action=/home/$USER/.scripts/acpi/handler.sh %e
$ stow -d ~/dotfiles -t ~/ acpi
# systemctl restart acpid.service

misc scripts

$ stow -d ~/dotfiles/ -t ~/ scripts

pdf readers

$ yaourt -S zathura-{pdf-poppler,ps} evince-light
$ stow -d ~/dotfiles/ -t ~/ zathura

compton

$ yaourt -S compton
$ stow -d ~/dotfiles/ -t ~/ compton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment