06b.Desktop environment Hyprland - Jubijub/arch-config GitHub Wiki

Desktop environment

Table of Contents

The goal is to reach a fully working Hyprland (on Wayland) environment with graphical apps configured.

Barebone Hyprland installation(Workstation)

workstation

This provides a base install of Hyprland, enough to be able to continue the configuration in a graphical environment.

sudo paru -S hyprland hyprcursor libva libva-nvidia-driver wayland-protocols xdg-desktop-portal-hyprland xdg-desktop-portal-gtk
  • hyprland: hyprland environement

  • libva and libva-nvidia-driver install the Video acceleration API, including an nVidia compatible implementation

  • wayland-protocols: Wayland communication protocols. Devel version to match hyprland-git

  • xdg-desktop-portal-hyprland for Dbus communication between apps (file picker, screensharing, etc…​) - See Hyprland wiki .Devel version to match

  • xdg-desktop-portal-gtk as it’s the fallback for the filepicker

Create the wrapper script / desktop file

This step will ensure SDDM exposes an Hyprland entry that will launch a wrapper script that will expose all teh right variables for Hyprland to work with nVidia drivers.

#!/bin/sh

# Session
export XDG_SESSION_TYPE=wayland
export XDG_SESSION_DESKTOP=Hyprland
export XDG_CURRENT_DESKTOP=Hyprland

# Wayland config
export _JAVA_AWT_WM_NONREPARENTING=1

# Commands
exec systemd-cat --identifier=hyprland /usr/bin/Hyprland $@

Make it executable

chmod +x ~/.local/bin/hyprland-wrapper.sh
cd /usr/share/wayland-sessions/
sudo cp hyprland.desktop hyprland-wrapper.desktop

Edit the file :

[Desktop Entry]
Name=Hyprland-wrapper (1)
Comment=An intelligent dynamic tiling Wayland compositor
Exec=/home/jubi/.local/bin/hyprland-wrapper.sh (2)
Type=Application
DesktopNames=Hyprland
Keywords=tiling;wayland;compositor;
  1. Change the name to disambiguate with the default Hyprland desktop entry

  2. Point to the wrapper created above

Configure Hyprland

Create or download ~/.config/hypr/hyprland.conf.

env = LIBVA_DRIVER_NAME,nvidia
env = XDG_SESSION_TYPE,wayland
env = GBM_BACKEND,nvidia-drm
env = __GLX_VENDOR_LIBRARY_NAME,nvidia
env = WLR_NO_HARDWARE_CURSORS,1
env = GDK_BACKEND,wayland,x11,*
env = QT_QPA_PLATFORM,wayland;xcb
env = ELECTRON_OZONE_PLATFORM_HINT,auto (1)
  1. Prevents flickering for Electron apps

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
localectl set-keymap us-acentos

In ~/.config/hypr/hyprland.conf, ensure the following things are present :

# Inputs
input {
	kb_layout = us, us
	kb_variant = , intl
}

...

# Toggle between keyboard layouts
# The keyboard name can be found with `hyprctl devices`
bind = $mainMod SHIFT, L, exec, hyprctl switchxkblayout mode-mode-75h next

TUIgreet (Login manager)

paru -S greetd-tuigreet

Enable the service

sudo systemctl enable --now greetd

Edit greetd config file sudo nvim /etc/greetd/config.toml

[terminal]
# The VT to run the greeter on. Can be "next", "current" or a number
# designating the VT.
vt = 1

# The default session, also known as the greeter.
[default_session]

# `agreety` is the bundled agetty/login-lookalike. You can replace `/bin/sh`
# with whatever you want started, such as `sway`.
command = "tuigreet --time --remember --remember-session --sessions /usr/share/wayland-sessions --theme border=magenta;text=cyan;prompt=green;time=red;action=blue;button=yellow;container=black;input=red"

# The user to run the command as. The privileges this user must have depends
# on the greeter. A graphical greeter may for example require the user to be
# in the `video` group.
user = "greeter"

Edit regreet config file sudo nvim /etc/greetd/regreet.toml

[commands]
reboot = [ "systemctl", "reboot" ]
poweroff = [ "systemctl", "poweroff" ]

[GTK]
# Whether to use the dark theme
application_prefer_dark_theme = true

Terminal tools & Firefox

Chrome

Installation

paru -S google-chrome

Ghostty

Installation

paru -S ghostty

Configuration

A config file is generated by default

nvim ~/.config/ghostty/config
  • Font: use ghostty +list-fonts to list the font, and pick the font-family (i.e. the first level name like JetBrainsMono Nerd Font). You can also use the second level, eg: CaskaydiaCove NF Light

  • Theme : use ghostty +list-themes to list all themes. Cattpuccin is built-in. eg: catppuccin-mocha

Reload the configuration with ctrl+shift+,

Zellij (tmux replacement)

Installation

paru -S zellij

Shell integration (autostart)

Fish

Add to ~/.config/fish/config.fish within the is_interactive block.

eval (zellij setup --generate-auto-start fish | string collect)
zsh

Add to ~/.zshrc:

eval "$(zellij setup --generate-auto-start zsh)"

Configuration

Check if the config file exists, if not :

mkdir ~/.config/zellij
zellij setup --dump-config > ~/.config/zellij/config.kdl

Edit the config :

 theme "catppuccin-macchiato"

Hyprland utilities and core apps

AGS-Hyprpanel

paru -S ags-hyprpanel-git swww

Ensure ~/.config/hypr/hyprland.conf contains this line :

exec-once = hyprpanel & nm-applet --indicator & hyprpaper

Bluetooth

Use nm-applet in the systray

Browser (Google Chrome)

paru -S google-chrome-stable

File manager (Thunar)

paru -S nautilus file-roller tumbler gvfs gvfs-nfs gvfs-smb
  • nautilus: GNOME’s lightweight file manager

  • file-roller: utility to manage archives, used by the archive plugin above

  • gvfs, gvfs-nfs, gvfs-smb: enables Nautilus to mount remote drivers (NFS, Samba``)

Menu (rofi)

Install Wayland fork

paru -S rofi-wayland
mkdir -p ~/.config/rofi/themes
configuration{
    modi: "run,drun,window";
    icon-theme: "Papirus-Dark";
    show-icons: true;
    terminal: "ghostty";
    drun-display-format: "{icon} {name}";
    location: 0;
    disable-history: false;
    hide-scrollbar: true;
    display-drun: "   Apps ";
    display-run: "   Run ";
    display-window: " 﩯  Window";
    display-Network: " 󰤨  Network";
    sidebar-mode: true;
}

Catppuccin theme

Download the theme :

mkdir ~/.config/rofi/themes
cd ~/.config/rofi/themes
$ curl -L "https://raw.githubusercontent.com/catppuccin/rofi/refs/heads/main/catppuccin-default.rasi" -O (1)
$ curl -L "https://raw.githubusercontent.com/catppuccin/rofi/refs/heads/main/themes/catppuccin-mocha.rasi" -O (2)
  1. Download the base theme file

  2. Download the specific flavour colors

Verify the content of ~/.config/rofi/config.rasi (towards the end of the file)

@theme "catppuccin-default"

Hyprland troubleshooting

GTK apps crash on loading due to missing icons

  • Ensure $XDG_DATA_DIRS is set and points at least to /usr/local/share:/usr/share:

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

GTK Catppuccin theme

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

ln -sf /usr/share/themes/Catppuccin-Mocha-Standard-Blue-Dark/ "$HOME/.themes/Catppuccin-Dark"
ln -sf "/usr/share/themes/Catppuccin-Mocha-Standard-Blue-Darkgtk-4.0/assets" "$HOME/.config/gtk-4.0/assets"
ln -sf "/usr/share/themes/Catppuccin-Mocha-Standard-Blue-Dark/gtk-4.0/gtk.css" "$HOME/.config/gtk-4.0/gtk.css"
ln -sf "/usr/share/themes/Catppuccin-Mocha-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

Install optional apps

paru -S baobab eog evince gnome-calculator gnome-characters gnome-disk-utility gnome-font-viewer gnome-logs flameshot

TODO: things to try * Swappy vs flameshot : https://github.com/jtheoof/swappy * Showmethekey : key logger ( https://github.com/AlynxZhou/showmethekey )

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 on the same computer

paru -S ntfs-3g
sudo mkdir /mnt/win11
sudo ntfs-3g <your_windows_partition> /mnt/win11 (1)
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 (2)
  1. For me, /dev/nvme2n1p3

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

Audio & Bluetooth

Install the stack

paru -S pipewire pipewire-pulse wireplumber alsa-firmware alsa-utils pavucontrol

Configure Pipewire

mkdir -p ~/.config/pipewire/media-session.d/
cp /usr/share/pipewire/*.conf ~/.config/pipewire/

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

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

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" }
]

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

Bluetooth

Install the stack

paru -S bluez bluez-utils
sudo systemctl enable bluetooth.service
sudo systemctl start bluetooth.service

Sync with Windows to prevent Windows and Linux stealing each other’s Bluetooth 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

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

Boot time error message "i2c i2c-0: Failed to register i2c client ITE8853:00 at 0x4e"

Status : no solution, but not blocking anything

GNOME apps

Install GNOME and graphical apps packages

Table 1. Table List of GNOME apps I use

Category

Application

Package name

Usage

Utilities

Disk Usage Analyzer

baobab

Produces a nice graphical view of directory size

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

⚠️ **GitHub.com Fallback** ⚠️