Skip to content

Instantly share code, notes, and snippets.

@0snap
Last active January 14, 2024 22:40
Show Gist options
  • Save 0snap/d95531542c113f90cf483ebe3d0f2baa to your computer and use it in GitHub Desktop.
Save 0snap/d95531542c113f90cf483ebe3d0f2baa to your computer and use it in GitHub Desktop.
Post-Installation Cheat Sheet for Arch Linux

Post-Installation Cheat Sheet for Arch Linux

This guide uses yay as the preferred AUR helper of choice.

Troubleshoot initial 'I have no Internet problems'

In case you did a fresh install and are now missing packages, yet cannot connect to the internet, simply boot via live-iso and arch-chroot into your system.

$ cryptsetup luksOpen /dev/nvme0n1p2 cryptroot      # only relevant in case of encrypted partition
$ mount /dev/mapper/cryptroot /mnt
$ wifi-menu                                         
$ arch-chroot /mnt

Install the packages for NetworkManager next, but refrain from doing the full setup in chroot mode. Rather reboot and login normally once you got the packages for getting online.

Install yay

Yay is an AUR helper (like yaourt). It's written in Go, new, fast, actively maintained...

$ git clone https://aur.archlinux.org/yay.git
$ cd yay
$ makepkg -si

Enable Colors

Edit /etc/pacman.conf. Find the section [options] and then under Misc Options simply uncomment the line that says Color.

Get Up To Date!

Before you install anything, make sure your package lists are up to date:

$ yay -Sy

It may as well be advisable to run a system update, but that is your decision.

$ yay -Syu

Internet via NetworkManager

$ yay -S dhclient extra/networkmanager extra/networkmanager-pptp extra/networkmanager-openvpn extra/nm-connection-editor extra/network-manager-applet
$ systemctl enable NetworkManager.service
$ systemctl enable NetworkManager-wait-online.service

Either reboot or systemctl start NetworkManager.service.

Connect to the Internet via Console

See the wiki for more nmcli examples.

$ nmcli device wifi list                                            # show available wifis
$ nmcli device wifi connect <WIFI_NAME> password <WIFI_PASSWORD>    # yeah I know, you can delete that from shell history though.

Xorg & Graphics

Find your driver.

$ yay -S xf86-video-intel

Generally, see the arch wiki for Xorg.

$ yay -S xorg-server xorg-xinit xorg-xrdb extra/xterm

Give it a shot, it should run with the defaults (looks crappy but should show a terminal and a cursor):

$ startx

Close all windows gradually with ctrl+d and/or ctrl+c to get back to your login shell.

Terminal Emulator

Pick a terminal emulator from this arch wiki list. I'll go with urxvt for now.

$ yay -S community/rxvt-unicode community/rxvt-unicode-terminfo

Xresources & Urxvt Configuration

Go to https://terminal.sexy and build your own foreground / background colors for your terminal.

Place the colors in your ~/.Xresources file.

For rxvt you must configure the Alt/Control keys to behave like xterm.

    ! Have Alt/Control-<arrow> behave like xterm
    URxvt.keysym.Control-Up:    \033[1;5A
    URxvt.keysym.Control-Down:  \033[1;5B
    URxvt.keysym.Control-Left:  \033[1;5D
    URxvt.keysym.Control-Right: \033[1;5C

    URxvt.keysym.M-Down:        \033[1;3B
    URxvt.keysym.M-Up:          \033[1;3A
    URxvt.keysym.M-Left:        \033[1;3D
    URxvt.keysym.M-Right:       \033[1;3C

You can find my full ~/.Xresrouces file as gist here.

Application Launcher

Folks used to go with dmenu but I much prefer rofi.

yay -S community/rofi

Configure Rofi

Really, check the wiki page. This is my config, in ~/.config/rofi/config:

    rofi.color-enabled:     true
    rofi.color-window:      #1c1c22, #3e646f, #3e646f
    rofi.color-normal:      #1c1c22, #d9d6ca, #85aab6, #d9d6ca, #78824B
    rofi.color-active:      #1c1c22, #d9d6ca, #85aab6, #d9d6ca, #78824B
    rofi.color-urgent:      #1c1c22, #d9d6ca, #85aab6, #d9d6ca, #78824B

    rofi.separator-style:   solid
    rofi.sidebar-mode:      false
    rofi.lines:             5
    rofi.font:              Source Code Pro Semibold 10.5
    rofi.bw:                1
    rofi.columns:           2
    rofi.padding:           5
    rofi.fixed-num-lines:   true
    rofi.hide-scrollbar:    true

Display Manager and Greeter

Install a display manager. This guide will go for lightdm together with its GTK greeter.

$ yay -S lightdm extra/lightdm-gtk-greeter
$ systemctl enable lightdm.service

Window Manager

This guide goes for i3 as window manager of choice. You could, of course, go for anything here.

$ yay -S i3-wm

Configure i3

  • Read the docs
  • Enable rofi:
    • find the line where dmenu is called and replace that line with the following
    • bindsym $mod+d exec rofi -show run

i3 brings its own Xsession, so together with our display manager from above (lightdm), we are good to reboot now and get greeted with a graphical environment.

$ reboot

Locking

There's a plethora of stuff to know about session locking. I'll go with xss-lock, because it grabs systemd and DPMS triggers. For the locking utility itself, I use light-locker. Again, you could go for anything here, like i3lock or similar.

$ yay -S community/light-locker community/xss-lock extra/xorg-xset
$ xset s on                                                             # enable xset
$ xset s 300                                                            # blank screen black after 5 mins of inactivity

Configure i3

Find the line that says something about i3lock and replace it with this:

  • exec --no-startup-id xss-lock -- dm-tool lock

Reboot or logout and login again.

Backlight

Light is a simple program to change backlight settings. The respective user must either be root or member in the video group.

$ yay -S light
$ usermod -aG video <YOUR_USER_NAME>

Configure i3

i3 allows for custom keybindings. Add the following lines to your ~/.config/i3/config:

  • # Brightness:
  • bindsym XF86MonBrightnessUp exec light -A 10 # increase screen brightness
  • bindsym XF86MonBrightnessDown exec light -U 10 # decrease screen brightness

Reboot or logout and login again.

Status Bar

Yup, we all waited for this one.

I prefer polybar over the i3-bar.

$ yay -S polybar

Configuration

Make sure to check out the polybar wiki page, there's quite a lot cool stuff possible. Best thing is that you don't have to fiddle with tray icons, for once.

  • Disable i3bar. Find find the bar: {} entry in ~/.config/i3/config and kick it out.
  • Create a polybar config to your liking.
  • Create a polybar startup script and place it in you i3 config.
  • Create a restart-script in case you plug in and out monitors frequently.

Create a Bar Configuration and Name it:

Note: The name at the top of the config file is used to reference the bar.

~/.config/polybar/config
------------------------

[bar/fixelbar]      <----- this name!
.....

You can find my polybar config in this gist.

Create a Start-Up Script

Example polybar start-up script. Caution: note that the bar is called fixelbar):

#/bin/bash

# start polybar on all monitors
for m in $(polybar --list-monitors | cut -d":" -f1); do
    MONITOR=$m polybar --reload fixelbar &
done

Put a exec --no-startup-id call to this script in your ~/.config/i3/config.

See this issue.

Create a Convenience Restart Script

When you plug monitors often, you have to restart polybar. Otherwise it will not show on the newly plugged monitors. I do it with a killall polybar 2>&1 > /dev/null and then call the above start script again. I'm sure here are nicer ways, you'll figure it out.

Desktop Background Images

Nitrogen is light and simple.

$ yay -S extra/nitrogen
$ nitrogen /path/to/image/directory/

Configure Image Restore with i3

Put this line in the i3 config: exec --no-startup-id /usr/bin/nitrogen --restore

Sound & PulseAudio

$ yay -S extra/pulseaudio extra/pulseaudio-bluetooth community/pasystray

Go to /etc/pulse/client.conf and change the line that says autospawn to yes. Then start it once.

$ yay pulseaudio --start

Configure i3

To have a tray icon in your status bar (polybar), add this to the i3 config file: exec --no-startup-id /usr/bin/pasystray

Bluetooth

$ yay -S bluez bluez-utils community/blueman
$ systemctl enable bluetooth.service
$ systemctl start bluetooth.service

Configure i3

To have a tray icon in your status bar (polybar), add this to the i3 config file: exec --no-startup-id /usr/bin/blueman-applet

Fonts & Icons

$ yay -S extra/texlive-fontsextra extra/xorg-fonts-misc extra/freetype2 extra/adwaita-icon-theme extra/bdf-unifont aur/siji-git extra/ttf-linux-libertine

GTK Themes & Appearance

Switcher for installed GTK Themes:

$ yay -S community/lxappearance-gtk3

Then go and find themes you like, either directly in the AUR (search yay gtk theme) or google around.

Z-Shell & Plugins

Useful Tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment