Skip to main content

i3 Desktop Environment in Arch Linux

··6 mins·
Arch-Linux
Makoto Morinaga
Author
Makoto Morinaga
A personal notebook for tech notes, coding, and system experiments.
Table of Contents

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:

Terminal
useradd -m -G wheel "user name"

Set up a password:

Terminal
passwd "user name"

Enable Sudo
#

Enable sudo on wheel group:

Terminal
EDITOR=vim visudo

To allow members of group wheel sudo access:

Terminal
%wheel      ALL=(ALL:ALL) ALL

Subsequent operations are performed by the created general user.

Network
#

Resolve
#

Enable resolve with systemed-resolved:

Terminal
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:

Terminal
# install
sudo pacman -S networkmanager

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

Date
#

Enable systemd-timesyncd:

Terminal
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:

Terminal
sudo pacman -S pacman-contrib

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

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

Useful packages
#

Install useful packages:

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

AUR Helper
#

Install yay as AUR Helper:

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

Zsh
#

Install Zsh:

Terminal
sudo pacman -S zsh

Change login shell Zsh:

Terminal
chsh -s /bin/zsh

Configure Zsh. Zsh config file

Maintenance of file system
#

SSD
#

Terminal
sudo systemctl enable fstrim.timer

Btrfs
#

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

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

GUI
#

Display Server
#

Install x as a display server:

Terminal
sudo pacman -S xorg-server

Display Manager
#

Install lightDM as a Display Manager:

Terminal
sudo pacman -S lightdm lightdm-gtk-greeter

Enable lightDM:

Terminal
sudo systemctl enable lightdm

Window Manager
#

Install i3(+i3blocks) as a Window Manager:

Terminal
sudo pacman -S i3

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

Window
#

Install picom

Terminal
sudo pacman -S picom

Configure picom. picom config

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

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

Screen Locker
#

Install light-locker as a screen locker:

Terminal
sudo pacman -S light-locker

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

Terminal
# 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:

Terminal
yay -S rofi-greenclip

Config Greenclip. Greenclip config

Start/enable the user unit greenclip.service:

Terminal
# 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:

Terminal
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:

Terminal
unzip Cica_vx.x.x.zip -d Cica

move Cica Font.

Terminal
mv Cica ~/.local/share/fonts/

Update font cache:

Terminal
fc-cache -vf

Fontconfig
#

Set up fontconfig. make config directory:

Terminal
mkdir $XDG_CONFIG_HOME/fontconfig/conf.d

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

$XDG_CONFIG_HOME/fontconfig/conf.d/system_fonts.conf
<?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:

Terminal
fc-cache -vf

Sound
#

Install sound server:

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

Bluetooth
#

Install bluetooth libraries.

Terminal
sudo pacman -S bluez bluez-utils blueman

Enable bluetooth.service

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

Keyboard Input
#

key repeat
#

Set up key repeat:

Terminal

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

key remap
#

Xremap is a key remapper for Linux

Install Xremap:

Terminal
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:

Terminal
sudo gpasswd -a "USER_NAME" input

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

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

Touchpad
#

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

Terminal
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:

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

Edit ~/.xprofile as follows:

Terminal
#!/bin/sh

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

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

Terminal
exec --no-startup-id fcitx5

wallpaper
#

Install wallpaper and feh:

Terminal
sudo pacman -S archlinux-wallpaper feh

Set up wallpaper:

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

GUI Applications
#

thunar
#

Install thunar as a file manager:

Terminal
sudo pacman -S thunar gvfs gvfs-smb sshfs

rofi
#

Install rofi as a clone of a simple switcher:

Terminal
sudo pacman -S rofi

Configure rofi. rofi config

wezterm
#

Install wezterm as a Terminal:

Terminal
sudo pacman -S wezterm

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

~/.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:

Terminal
sudo pacman -S nextcloud-client

Install libraries for Auto login:

Terminal
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:

Terminal
yay -S google-chrome

Enpass
#

Install Enpass:

Terminal
yay -S enpass-bin

gufw
#

Install gufw:

Terminal
yay -S gufw

OpenVPN
#

Install OpenVPN support:

Terminal
sudo pacman -S networkmanager-openvpn

Install nm-applet as GUI:

Terminal
sudo pacman -S network-manager-applet

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

Terminal
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.

Related

Installing Emacs28 with Native compilation enabled
··4 mins
Arch-Linux Macos Ubuntu Emacs
Installing yay on Arch Linux
··1 min
Arch-Linux Yay
Arch Linux Initial Setup
··2 mins
Arch-Linux