Skip to content

6a.Desktop environment Qtile

Julien Chappuis edited this page Apr 6, 2024 · 1 revision

Desktop environment

Table of Contents

The goal is to reach a fully working Qtile (or GNOME) environment with graphical apps configured.

Install X.org (Workstation)

workstation
paru -S xorg-server xorg-xinit xterm
cd /etc/X11/xorg.conf.d/
sudo curl -L "https://raw.githubusercontent.com/Jubijub/arch-config/master/etc/X11/xorg.conf.d/20-nvidia.conf" -O
  • Test it with startx : it should start X, and bring you to an old fashion style desktop environment, with a terminal window

  • If it works, exit X by typing exit in the terminal

Install X.org (Laptop)

laptop
paru -S xorg-server xorg-xinit xterm

Install GDM as the display manager

paru -S gdm
sudo vim /etc/gdm/custom.conf

Uncomment the line WaylandEnable=false

sudo systemctl enable gdm.service (1)
  1. ensures gdm will start and provide a graphical login after the boot

Clone my repository of config files

You can then use command line or Thunar to copy the home/.conf` folder into your ~/.config.

cd ~/Downloads
git clone https://github.com/Jubijub/arch-config.git

Overwrite the home folder with my settings.

cp -rf ~/Downloads/arch-config/home/jubi /home

This will provide the needed configuration for all the tools listed below.

Install useful command line tools

Since my zsh and fish config use those tools, installing them will fix the errors about those tools missing.

pacman -S bat exa fd fzf
  • bat` is a replacement of cat with syntax higlighting, line numbers, etc…​

  • exa is a replacement of ls with better coloring, Git support, etc…​

  • fd is an enhanced find with a simpler syntax.

  • fzf is a fuzzy search tool, to search with partial names.

  • ripgrep is a grep replacement.

Configure Bat

Configure Bat theme

cd ~/Download
git clone https://github.com/catppuccin/bat.git
cd bat
mkdir -p "$(bat --config-dir)/themes"
cp *.tmTheme "$(bat --config-dir)/themes"
bat cache --build
bat --list-themes

Edit ~/.config/bat/config

--theme="Catppuccin-macchiato"

Set bat as the fzf previewer

Edit .zshenv

export FZF_DEFAULT_OPTS="--height 20% --border --preview 'bat --style=numbers --color=always --line-range :500 {}'"

Configure Exa

Install completion files

For Zsh :

cd ~/.zfunc
curl -L "https://raw.githubusercontent.com/ogham/exa/master/completions/zsh/_exa" -O

For Fish :

cd ~/.config/fish/completions
curl -L "https://raw.githubusercontent.com/ogham/exa/master/completions/fish/exa.fish" -O

Verify .zshrc

alias exa"exa --color --time-style=long-iso"
alias ls="exa"
alias la="ls --long --header --icons"
alias lg="ls --long --header --icons --git"

Verify config.fish

alias exa"exa --color --time-style=long-iso"
alias ls="exa"
alias la="ls --long --header --icons"
alias lg="ls --long --header --icons --git"

Configure fd

Verify .zshrc

alias fd="fd -HI" #(1)
  1. Ensures fd doesn’t filter hidden directories or files

Verify config.fish

alias fd="fd -HI" #(1)
  1. Ensures fd doesn’t filter hidden directories or files

Install kitty

Install

paru -S kitty
paru -R xterm (1)
  1. Unless you use raw X.org, you probably won’t need this :)

Install Qtile

Install Qtile

paru -S qtile qtile-extras-git rofi python-rofi python-dbus-next network-manager-applet blueman bottom picom-git xorg-xrandr dunst

Install useful GNOME softwares

(see the table of GNOME apps below)

paru -S baobab eog evince file-roller gnome-calculator gnome-characters gnome-disk-utility gnome-font-viewer gnome-logs flameshot gvfs gvfs-nfs gvfs-smb thunar thunar-archive-plugin tumbler thunar-volman

Configure Keyboard as US intl with Dead keys in X and GNOME

Configure Keyboard

gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us+intl')]"
localectl set-x11-keymap us "" altgr-intl

Configure the Catppuccin theme (wallpaper / color / icons / cursors)

GTK theme

paru -S catppuccin-gtk-theme-macchiato
mkdir -p ~/.themes

ln -sf /usr/share/themes/Catppuccin-Macchiato-Standard-Blue-Dark/ "$HOME/.themes/Catppuccin-Dark"
ln -sf "/usr/share/themes/Catppuccin-Macchiato-Standard-Blue-Darkgtk-4.0/assets" "${HOME}/.config/gtk-4.0/assets"
ln -sf "/usr/share/themes/Catppuccin-Macchiato-Standard-Blue-Dark/gtk-4.0/gtk.css" "${HOME}/.config/gtk-4.0/gtk.css"
ln -sf "/usr/share/themes/Catppuccin-Macchiato-Standard-Blue-Dark/gtk-4.0/gtk-dark.css" "${HOME}/.config/gtk-4.0/gtk-dark.css"

Verify the GTK3 / GT4 configurations :

~/.config/gtk-3.0/settings.ini and ~/.config/gtk-4.0/settings.ini

[Settings]
gtk-theme-name=Catppuccin-Dark
...
gtk-application-prefer-dark-theme=1

Cursors

paru -S catppuccin-cursors-macchiato

Create ~/.icon/default/index.theme

[icon theme]
Inherits=Catppuccin-Macchiato-Dark-Cursors

Verify ~/.config/gtk-3.0/settings.ini and ~/.config/gtk-4.0/settings.ini

[Settings]
gtk-cursor-theme-name = Catppuccin-Macchiato-Dark-Cursors

Verify ~/.Xresources

Xcursor.theme: Catppuccin-Macchiato-Dark-Cursors
Xcursor.size: 24

Verify ~/.xinitrc

xrfb -merge ~/.Xresources

Set the cursor theme for GNOME :

gsettings set org.gnome.desktop.interface cursor-theme Catppuccin-Macchiato-Dark-Cursors
gsettings set org.gnome.desktop.interface cursor-size 24

GTK Cattppuccin Papirus Icons

paru -S papirus-icon-theme papirus-folders-catppuccin-git

Verify ~/.config/gtk-3.0/settings.ini and ~/.config/gtk-4.0/settings.ini

[Settings]
...
gtk-icon-theme-name=Papirus-Dark
...

Choose the folder color :

papirus-folders -l
papirus-folders -C cat-macchiato-lavender

Rofi

Download the theme

mkdir ~/.config/rofi
curl -L "https://raw.githubusercontent.com/catppuccin/rofi/main/basic/.local/share/rofi/themes/catppuccin-macchiato.rasi" -O

Verify the content of ~/.config/rofi/config.rasi

@theme "catppuccin-macchiato"

Activate bluetooth service

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

Reboot

sudo reboot
Note
After the reboot you should get the graphical login provided by GDM

Debug Qtile

Verify that config.py compiles

python ~/.config/qtile/config.py (1)
  1. This should yield no errors.

Check Qtile logs

tail -f ~/.local/share/qtile/qtile.log

Install Chrome

paru -S google-chrome-beta
  • Log in Chrome

  • Activate the Chrome extensions

Configure Fish

I use Fish as my main shell for its amazing completions, and build in features (suggestions, etc…​).

Install Fisher plugin manager

curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher

Catppuccin Macchiato Theme

fisher install catppuccin/fish
fish_config theme save "Catppuccin Macchiato"

Configure fzf

fisher install PatrickF1/fzf.fish

Verify ~/.config/fish/config.fish

# fzf
set -Ux FZF_DEFAULT_OPTS "\
--height 20% --border \
--preview 'bat --style=numbers --color=always --line-range :500 {}' \
--color=bg+:#363a4f,bg:#24273a,spinner:#f4dbd6,hl:#ed8796 \
--color=fg:#cad3f5,header:#ed8796,info:#c6a0f6,pointer:#f4dbd6 \
--color=marker:#f4dbd6,fg+:#cad3f5,prompt:#c6a0f6,hl+:#ed8796"

Configure Starship.rs theme

paru -S starship

make fish the default shell

chsh -s /bin/fish

Configure Zsh

I use Zsh when a POSIX-compliant alternative is required, or when I used something that doesn’t support Fish well, due to its amazing completion capabilities, and the superb command line theme Powerlevel10k.

note : configuration is shown for information only. If you use my .zshenv and .zshrc files, all the plugins will be configured already.

Catppuccin Machiato Theme

cd ~/Downloads
git clone https://github.com/catppuccin/zsh-syntax-highlighting.git
cd zsh-syntax-highlighting/themes/
mkdir ~/.zsh
cp -v catppuccin_macchiato-zsh-syntax-highlighting.zsh ~/.zsh/

Edit .zshrc

source ~/.zsh/catppuccin_macchiato-zsh-syntax-highlighting.zsh

Install Zsh extensions

paru -S zsh-completions zsh-autosuggestions zsh-fast-syntax-highlighting fzf zsh-theme-powerlevel10k

Configure Syntax highlighting

Add to .zshrc

source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
fast-theme free

Configure Fish-like auto-suggestions

Add to .zshrc

source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh

Configure fzf

Add to .zshrc

#fzf
source /usr/share/fzf/key-bindings.zsh
source /usr/share/fzf/completion.zsh

Add to .zshenv

#Catpuccin Macchiato theme
export FZF_DEFAULT_OPTS="--height 20% --border \
     --preview 'bat --style=numbers --color=always --line-range :500 {}' \
     --color=bg+:#363a4f,bg:#24273a,spinner:#f4dbd6,hl:#ed8796 \
     --color=fg:#cad3f5,header:#ed8796,info:#c6a0f6,pointer:#f4dbd6 \
     --color=marker:#f4dbd6,fg+:#cad3f5,prompt:#c6a0f6,hl+:#ed8796"

export MANPAGER="sh -c 'col -bx | bat -l man -p'"

Install Powerlevel 10k

paru -S zsh-theme-powerlevel10k
  • Add source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme to ~/.zshrc

  • Run Powerlevel10k configuration

p10k configure

Install fonts

Install windows 11 fonts

Due to copyright issue, you will have to build your own Windows 11 font package.

Retrieve the fonts from a Windows install

paru -S ntfs-3g
sudo mkdir /mnt/win11
sudo ntfs-3g <your_windows_partition> /mnt/win11
mkdir -p ~/Downloads/source_fonts_11
cp /mnt/win11/Windows/Fonts/*.tt* ~/Downloads/source_fonts_11
cp /mnt/win11/Windows/System32/Licenses/neutral/_Default/**/license.rtf ~/Downloads/source_fonts_11 (1)
  1. the ** may resolve to Core, or Professional

Install

Important
I cannot legally provide the set of Windows 11 fonts. If you have a valid Windows 11 installation, you can retrieve the fonts in c:\Windows\Fonts (all *.ttf and *.ttc files).
  • Download the package containing the fonts (On my Google drive : /Documents/\_IT/PCs/Apps/Linux/ttf-ms-win11-fonts.tar.bz2)

tar -xJvf source_fonts_11.tar.xz
cd source_fonts
curl -L 'https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=ttf-ms-win11' -o PKGBUILD
makepkg #no -si
sudo paru -U ttf-ms-win11-TAB-FOR-COMPLETION.pkg.tar.zst
Warning
DO NOT do makepkg -si or it will install all the font packages (JP, TW, CN, etc…​)
Note
if there are any version mismatch : 1/ check the package page, usually someone posts the latest 2/ run sha256sum <the_font_name> to find the new checksum

Install other ttf fonts

paru -S ttf-dejavu noto-fonts

Install Nerd fonts (for console and coding)

Nerd fonts are well known monospace coding & terminal fonts (JetBrains Mono, FiraCode, Inconsolatas, Droid Mono, etc…​) patched with extra glyphs. See Nerd fonts Github. Installing these fonts is the last thing required to have a fully functional Tide Fish prompt.

Warning
Make sure you use at least version 2.1 as it fixes a bug with monotype fonts

Fonts are packaged individually, and can be found searching aur.archlinux.org.

paru -S ttf-jetbrains-mono-nerd
paru -S ttf-cascadia-code-nerd
paru -S ttf-hack-nerd
paru -S ttf-firacode-nerd

Bluetooth

Install the stack

paru -S bluez bluez-utils pipewire pipewire-pulse wireplumber alsa-firmware alsa-utils pavucontrol pasystray
mkdir -p ~/.config/pipewire/media-session.d/
cp /usr/share/pipewire/*.conf ~/.config/pipewire/

Configure

Modify the ~/.config/pipewire/pipewire.conf

default.clock.allowed-rates = [ 44100 48000 ]
systemctl --user enable pipewire.service
systemctl --user enable pipewire-pulse.service
sudo systemctl enable bluetooth.service
sudo systemctl start bluetooth.service

Sync with Windows to prevent Windows and Linux stealing each other’s pairings

  • Start with Windows, and pair the device there (mine is a pair of Bose QuietConnect headsets) : test that it works there

  • Go to Arch, and do the pairing as described below

Pair a device

❯ bluetoothctl
Agent registered
[bluetooth]# power on
Default agent request successful
[CHG] Device 78:2B:64:EB:A6:62 Modalias: bluetooth:v009Ep402Fd0207
Changing power on succeeded
[bluetooth]# scan on
Discovery started
[CHG] Controller BC:09:1B:0F:12:D8 Discovering: yes
[NEW] Device 03:D2:F3:0C:A4:0E 03-D2-F3-0C-A4-0E
[NEW] Device 05:66:F9:5E:66:B9 05-66-F9-5E-66-B9
[NEW] Device 78:2B:64:EB:A6:62 LE-JubiBoseQCEarbuds
[NEW] Device A8:51:AB:96:D6:D7 A8-51-AB-96-D6-D7
[NEW] Device 74:AC:B9:16:7A:E2 UCK
[NEW] Device 7C:34:A7:2C:30:DC 7C-34-A7-2C-30-DC
[NEW] Device 59:41:3F:9A:27:7B 59-41-3F-9A-27-7B
[CHG] Device 78:2B:64:EB:A6:62 Class: 0x00240418
[CHG] Device 78:2B:64:EB:A6:62 Icon: audio-headphones
[NEW] Device EC:A9:07:24:BD:94 EC-A9-07-24-BD-94
[bluetooth]# pair 78:2B:64:EB:A6:62
Attempting to pair with 78:2B:64:EB:A6:62
[CHG] Device 78:2B:64:EB:A6:62 Connected: yes
[CHG] Device 78:2B:64:EB:A6:62 Name: JubiBoseQCEarbuds
[CHG] Device 78:2B:64:EB:A6:62 Alias: JubiBoseQCEarbuds
[CHG] Device 78:2B:64:EB:A6:62 Bonded: yes
[CHG] Device 78:2B:64:EB:A6:62 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
[CHG] Device 78:2B:64:EB:A6:62 UUIDs: 00000000-deca-fade-deca-deafdecacaff
[CHG] Device 78:2B:64:EB:A6:62 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
[CHG] Device 78:2B:64:EB:A6:62 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device 78:2B:64:EB:A6:62 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device 78:2B:64:EB:A6:62 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 78:2B:64:EB:A6:62 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 78:2B:64:EB:A6:62 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device 78:2B:64:EB:A6:62 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 78:2B:64:EB:A6:62 UUIDs: 0000eb03-d102-11e1-9b23-00025b00a5a5
[CHG] Device 78:2B:64:EB:A6:62 UUIDs: 85dbf2f9-73e3-43f5-a129-971b91c72f1e
[CHG] Device 78:2B:64:EB:A6:62 UUIDs: 9b26d8c0-a8ed-440b-95b0-c4714a518bcc
[CHG] Device 78:2B:64:EB:A6:62 ServicesResolved: yes
[CHG] Device 78:2B:64:EB:A6:62 Paired: yes
Pairing successful
[CHG] Device 78:2B:64:EB:A6:62 ServicesResolved: no
[CHG] Device 78:2B:64:EB:A6:62 Connected: no
[CHG] Device 78:2B:64:EB:A6:62 Name: LE-JubiBoseQCEarbuds
[CHG] Device 78:2B:64:EB:A6:62 Alias: LE-JubiBoseQCEarbuds
[CHG] Device 78:2B:64:EB:A6:62 ManufacturerData Key: 0x1c03
[CHG] Device 78:2B:64:EB:A6:62 ManufacturerData Value:
  51 18 64 db 08 26 a2 09 c7 d0 4f                 Q.d..&....O
[NEW] Device CB:D1:6D:82:70:09 Salon - lustre
[NEW] Device 3E:73:C7:05:51:8E 3E-73-C7-05-51-8E
[bluetooth]# exit

Once paired, use bt-dualboot

paru -S bt-dualboot
sudo mount -t ntfs3 /dev/nvme0n1p3 /mnt/win11  (1)
sudo bt-dualboot --list-win-mounts (2)
sudo bt-dualboot -l (3)
sudo bt-dualboot --sync-all -b /tmp/backup/dualboot (4)
  1. Mount your C:\windows partition (as bt-dualboot needs to read from windows registry)

  2. Ensures bt-dualboot detects the windows partition mount

  3. Lists all devices paired on both OS : your device must be listed there

  4. Sync the pairing keys and backup the existing setup

Sounds

Set output to a different HDMI monitor

List the available cards

pact list cards

Make note of the card number (eg: #48) for the card named like alsa_card.pci-0000_0a_00.1. It should contains various ports named hdmi-output-n, and those ports have a property device.product.name named after the monitor itself. This will give you the port. Make note of the profile listed in the part of provile(s): output:hdmi-stereo-xxxxxx

Use tab completion to autocomplete :

pact set-card-profile 48 output:hdmi-stereo-extra1

Ensure Pipewire switches to the newly connected device

mkdir -p ~/.config/pipewire/pipewire-pulse.conf.d/
nvim ~/.config/pipewire/pipewire-pulse.conf.d/switch-on-connect.conf
# override for pipewire-pulse.conf file
pulse.cmd = [
    { cmd = "load-module" args = "module-always-sink" flags = [ ] }
    { cmd = "load-module" args = "module-switch-on-connect" }
]

Finishing touches

Getting rid of missing firmwares messages during mkinitcpio

During mkinitcpio, the following messages appear on my workstation. They can be removed by installing the relevant firmware :

WARNING: Possibly missing firmware for module: 'xhci_pci'
WARNING: Possibly missing firmware for module: 'ast'
WARNING: Possibly missing firmware for module: 'aic94xx'
WARNING: Possibly missing firmware for module: 'qla1280'
WARNING: Possibly missing firmware for module: 'wd719x'
WARNING: Possibly missing firmware for module: 'qed'
WARNING: Possibly missing firmware for module: 'qla2xxx'
WARNING: Possibly missing firmware for module: 'bfa'

Install the meta-package mkinitcpio-firmware :

paru -S mkinitcpio-firmware

Known problems

Bluetooth: hci0: Malformed MSFT vendor event: 0x02

Status : no solution, but not blocking anything https://bbs.archlinux.org/viewtopic.php?id=276815&p=2

i2c i2c-0: Failed to register i2c client ITE8853:00 at 0x4e

Status : no solution, but not blocking anything

Install GNOME

Install GNOME and graphical apps packages

Table 1. Table List of GNOME apps I use

Category

Application

Package name

Usage

Core

Nautilus

nautilus

GNOME File manager

GNOME Sushi

sushi

GNOME File previewer, integrates with Nautilus

GNOME Display Manager

gdm

Standard display manager / login manager for GNOME

GNOME Control Center

gnome-control-center

GNOME control panel / system settings

GNOME Session

gnome-session

Called by GDM, starts a GNOME session

GNOME Settings

gnome-settings-daemon

GNOME settings daemon

GNOME Shell

gnome-shell

GNOME Shell interface

GNOME Shell Extensions

gnome-shell-extensions

GNOME Shell extensions manager, allowing to manage extensions like Dash to Panel

Mutter

mutter

GNOME Shell window manager

Utilities

Disk Usage Analyzer

baobab

Produces a nice graphical view of directory size

GNOME System Monitor

gnome-system-monitor

Monitors processes, CPU, memory usage, etc…​

GNOME Calculator

gnome-characters

A character map viewer

GNOME Character map

gnome-calculator

A scientific calculator

GNOME Disk Utility

gnome-disk-utility

Utility to view, partition disks

GNOME Font viewer

gnome-font-viewer

Visualize fonts installed on the computer

GNOME Logs

gnome-logs

systemd logs viewer

dconf-editor

dconf-editor

Visual editor of GNOME dconf

GNOME Tweaks

gnome-tweaks

Advanced GNOME settings UI

File viewers

Eye of GNOME

eog

GNOME image viewer

Evince

evince

GNOME PDF viewer

GNOME Archive Manager

file-roller

GNOME Archive manager, supporting all main formats

Content authoring

GNOME Screenshot

gnome-screenshot

GNOME Screenshot / screencast app

Flameshot

flameshot

Powerful screenshot app with the ability to edit screenshots

paru -S baobab eog evince file-roller gdm gedit gnome-calculator gnome-characters gnome-control-center gnome-disk-utility gnome-font-viewer gnome-logs gnome-screenshot flameshot gnome-session gnome-settings-daemon gnome-shell gnome-shell-extensions gnome-system-monitor gvfs gvfs-google gvfs-smb  mutter nautilus sushi dconf-editor
sudo vim /etc/gdm/custom.conf
  • Uncomment the line WaylandEnable=false

sudo systemctl enable gdm.service (1)
  1. ensures gdm will start and provide a graphical login after the boot

Install GNOME extensions

  • Go to https://extensions.gnome.org/

  • Install the Chrome extension

  • Browse the catalog and install :

    • Arc Menu

    • Dash to Panel

    • No overview at start-up

    • Tray Icons: Reloaded

Configure GNOME extensions

Arc Menu

  • Display Arc menu on : Dash to Panel

Dash to Panel

  • Panel screen position: On top

Configure Adwaita theme and font antialiasing

Configure theme and antialiasing

  • Launch Tweaks app

  • Appearance > Themes > Applications > Adwaita-Dark

  • Fonts > Antialiasing > Subpixel

Wallpaper

Set the wallpaper

  • Download wallpaper from Google Drive : /Documents/_IT/PCs/03 - T480s/wallpaper (go on reddit/r/thinkpad to find cool Thinkpad wallpapers)

  • Move the wallpaper to ~/

  • Right click on the wallpaper > Change background… > Background > Pictures > pick the wallpaper

Clone this wiki locally