i3 Desktop Environment in Arch Linux

i3 Desktop Environment in Arch Linux

August 23, 2022(August 23, 2023)
arch-linux

Important
I have not maintained this page since we moved from i3 to sway.
We recommend the following sway page.
sway Desktop Environment in Arch Linux


This note is recorded when I configure Arch Linux with i3 Desktop Environment.

User #

“User” section operations are performed on the root account.

Create general user #

Add general user:

useradd -m -G wheel "user name"

Set up a password:

passwd "user name"

Enable Sudo #

Enable sudo on wheel group.

EDITOR=vim visudo

To allow members of group wheel sudo access:

%wheel      ALL=(ALL:ALL) ALL

Subsequent operations are performed by the created general user.

Network #

Resolve #

Enable resolve with systemed-resolved:

sudo systemctl start systemd-resolved.service
sudo systemctl enable systemd-resolved.service

sudo mv /etc/resolv.conf /etc/resolv.conf.org
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

NetworkManager #

Install NetworkManager.
Use NetworkManager instead of systemd-netwokrd for vpn connection:

# install
sudo pacman -S networkmanager

sudo systemctl enable NetworkManager.service
sudo systemctl start NetworkManager.service

Date #

Enable systemd-timesyncd:

sudo systemctrl start systemd-timesyncd.service
sudo systemctrl enable systemd-timesyncd.service

Pacman #

Comparing versions before updating #

To see old and new versions of available packages, uncomment the “VerbosePkgLists” line in /etc/pacman.conf.

Enabling parallel downloads #

To download packages in parallel, uncomment the “VerbosePkgLists” line in /etc/pacman.conf.

Coloring #

To colorise the output, uncomment the “Color” line in /etc/pacman.conf.

Pacman #

To Make Pacman appear in the output of pacman. Add “ILoveCandy” under [options] in /etc/pacman.conf.

Cleaning the package cache #

To clean the package cache, install paccache privided within the pacman-contrib

sudo pacman -S pacman-contrib

Enable and start paccache.timer to discard unused packages weekly:

sudo systemctl enable paccache.timer
sudo systemctl start paccache.timer

Useful packages #

Install useful packages:

sudo pacman -S git wget man-db man-pages

AUR Helper #

Install yay as AUR Helper:

mkdir -p ~/.local/src
cd ~/.local/src
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

Zsh #

Install Zsh:

sudo pacman -S zsh

Change login shell Zsh:

chsh -s /bin/zsh

Configure Zsh.
Zsh config file

Maintenance of file system #

SSD #

sudo systemctl enable fstrim.timer

Btrfs #

# root(/)
sudo systemctl enable [email protected]

# /home (if mount)
sudo systemctl enable [email protected]

GUI #

Display Server #

Install x as a display server:

sudo pacman -S xorg-server

Display Manager #

Install lightDM as a Display Manager:

sudo pacman -S lightdm lightdm-gtk-greeter

Enable lightDM:

sudo systemctl enable lightdm

Window Manager #

Install i3(+i3blocks) as a Window Manager:

sudo pacman -S i3

Configure i3.
i3 config
Configure i3-blocks.
i3blocks config

Window #

Install picom

sudo pacman -S picom

Configure picom.
picom config

add auto-start config to ~/.config/i3/config:

exec --no-startup-id picom --config ~/.config/picom/picom.conf

Screen Locker #

Install light-locker as a screen locker:

sudo pacman -S light-locker

add auto-start config to ~/.config/i3/config:

# start
exec --no-startup-id "light-locker --lock-on-suspend"
# set lock command
bindsym $mod+Shift+x exec --no-startup-id light-locker-command -l

Clipboard #

Install Greenclip as a clipboard manager:

yay -S rofi-greenclip

Config Greenclip.
Greenclip config

Start/enable the user unit greenclip.service.

# start
systemctrl --user start greenclip.service
# enable
systemctrl --user enable greenclip.service

Multi Monitor #

autorandr automatically detect when a new display is connected, and then change the layout based on profiles.

Font #

Noto font #

Install Noto font:

sudo pacman -S noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra

Cica font #

Install Cica font as a programming font.

Download latest Cica font.
Unzip zip file:

unzip Cica_vx.x.x.zip -d Cica

move Cica Font.

mv Cica ~/.local/share/fonts/

Update font cache:

fc-cache -vf

Fontconfig #

Set up fontconfig.
make config directory:

mkdir $XDG_CONFIG_HOME/fontconfig/conf.d

Edit $XDG_CONFIG_HOME/fontconfig/conf.d/system_fonts.conf as follows:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>serif</family>
    <prefer>
      <family>Noto Serif</family>
      <family>Noto Serif CJK JP</family>
    </prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Noto Sans</family>
      <family>Noto Sans CJK JP</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>Noto Sans Mono</family>
      <family>Noto Sans Mono CJK JP</family>
    </prefer>
  </alias>
</fontconfig>

Rebuild fontconfig:

fc-cache -vf

Sound #

Install sound server:

sudo pacman -S pipewire wireplumber pipewire-alsa pipewire-pulse pavucontrol

Bluetooth #

Install bluetooth libraries.

sudo pacman -S bluez bluez-utils blueman

Enable bluetooth.service

sudo systemctl start bluetooth.service
sudo systemctl enable bluetooth.service

Keyboard Input #

key repeat #

Set up key repeat:

exec --no-startup-id xset r rate 200 25

key remap #

Xremap is a key remapper for Linux

Install Xremap:

yay -S xremap-x11-bin

Config Xremap.
xremap config

Run xremap without sudo as follows.
Running xremap without sudo

And, the following is also required.

sudo gpasswd -a "USER_NAME" input

add auto-start config to ~/.config/i3/config:

exec --no-startup-id xremap ~/.config/xremap/config.yml

Touchpad #

Edit /etc/X11/xorg.conf.d/50-touchpad.conf as follows:

Section "InputClass"
  Identifier "libinput touchpad"
  Driver "libinput"
  MatchIsTouchpad "on"
  Option "Tapping" "on"
  Option "naturalScrolling" "on"
  Option "Accel Speed" "1"
EndSection

Input Method #

Install fcitx5-skk:

sudo pacman -S fcitx5-skk fcitx5-im fcitx5-configtool

Edit ~/.xprofile as follows:

#!/bin/sh

export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx

add auto-start config to ~/.config/i3/config:

exec --no-startup-id fcitx5

wallpaper #

Install wallpaper and feh:

sudo pacman -S archlinux-wallpaper feh

Set up wallpaper:

exec --no-startup-id "feh --no-fehbg --bg-fill '/usr/share/backgrounds/archlinux/small.png'"

GUI Applications #

thunar #

Install thunar as a file manager

sudo pacman -S thunar gvfs gvfs-smb sshfs

rofi #

Install rofi as a clone of a simple switcher.

sudo pacman -S rofi

Configure rofi.
rofi config

wezterm #

Install wezterm as a Terminal

sudo pacman -S wezterm

Configure wezterm in ~/.config/wezterm/wezterm.lua

local wezterm = require 'wezterm';

return {
  font = wezterm.font("Cica"),
  use_ime = true,
  font_size = 20.0,
  color_scheme = "Japanesque",
  hide_tab_bar_if_only_one_tab = true,
  adjust_window_size_when_changing_font_size = false,
}

NextCloud #

Install client:

sudo pacman -S nextcloud-client

Install libraries for Auto login:

sudo pacman -S qtkeychain-qt5 libsecret gnome-keyring seahorse

LightDM already has the necessary PAM configuration.
The password for the user account should be the same as the default keyring.

Google Chrome #

Install Google Chrome:

yay -S google-chrome

Enpass #

Install Enpass:

yay -S enpass-bin

gufw #

Install gufw:

yay -S gufw

OpenVPN #

Install OpenVPN support:

sudo pacman -S networkmanager-openvpn

Install nm-applet as GUI:

sudo pacman -S network-manager-applet

Add auto-start config to ~/.config/i3/config:

exec --no-startup-id nm-applet

Click the plus sign to add a new connection and choose OpenVPN In desktop environment network setting.
Import The client configuration profile by selecting Import a saved VPN configuration… and selecting the appropriate file(xxx.ovpn file).

Set only certain network connections via vpn.
Click IPv4 Settings -> Routes… in vpn config.
Add certain network, and check Use this connection only for resources on it network.