Skip to content

6b.Desktop environment Hyprland

Julien Chappuis edited this page Apr 6, 2024 · 5 revisions

Desktop environment

Table of Contents

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

Install Hyprland (Workstation)

workstation

This provides a base install of Hyprland.

sudo paru -S hyprland-git hyprcursor libva libva-nvidia-driver-git polkit-kde-agent wayland-protocols-git wlroots-git xdg-desktop-portal-hyprland-git
  • hyprland-git: latest devel version of Hyprland, usually the one that works best with nVidia cards

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

  • polkit-kde-agent is needed for authentication dialogs

  • qt5-wayland and qt5ct enable QT5 on Wayland

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

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

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

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')]"
sudo localectl set-x11-keymap us 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

Lemurs (Login manager)

paru -S lemurs

Enable the service

sudo systemctl enable lemurs.service

Add the startup script

sudo mkdir -p /etc/lemurs/wayland
cd /etc/lemurs/wayland
sudo cp ~/.local/bin/hyprland-wrapper.sh .

Hyprland utilities and core apps

Warning
ensure $XDG_DATA_DIRS is set for your shell, or you will run into issues loading icons

Install kitty

paru -S kitty

Download the config file (it’s the vanilla file, except for the font, and disabling audio bell).

mkdir -p ~/.config/kitty
cd ~/.config/kitty
curl -L "https://raw.githubusercontent.com/Jubijub/arch-config/master/home/jubi/.config/kitty/kitty.conf" -O

Set Catppuccin Machiato theme :

kitty +kitten themes

Select the theme and choose the option M (modify the configuration).

Waybar

paru -S waybar network-manager-applet

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

exec-once=waybar & nm-applet --indicator

Bluetooth

Use nm-applet in the systray

Systray

Use Waybar’s tray module.

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-lbonn-wayland
mkdir -p ~/.config/rofi
configuration{
    modi: "run,drun,window";
    icon-theme: "Papirus-Dark";
    show-icons: true;
    terminal: "kitty";
    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/main/basic/.local/share/rofi/themes/catppuccin-mocha.rasi" -O

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

@theme "catppuccin-mocha"

Notifications (Dunst)

paru -S dunst

Catppuccin theme

Paste the content of your preferred Catppuccin flavour into dunstrc : https://github.com/catppuccin/dunst/tree/main/src

mkdir -p ~/.config/dunst/
nvim ~/.config/dunst/dunstrc

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

GTK Papirus + Catppuccin-Papirus Icons

paru -S hicolor-icon-theme papirus-icon-theme papirus-folders-catppuccin-git #(1)
  1. hicolor is installed to max compatibility as some apps have hardcoded hicolor icons

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

QT Catppuccin theme

QT Cattpuccin

cd ~/Downloads
git clone https://github.com/catppuccin/qt5ct.git
cd qt5ct/themes
cp Catppuccin-Mocha.conf ~/.config/qt5ct/colors

Set the theme manually by running qt5ct > Appearance > Palette: Color scheme

Qvantum

paru -S qvantum
cd ~/Downloads
git clone https://github.com/catppuccin/Kvantum.git
  • Open Qvantum manager

  • Pick the Catppuccin flavour you like and install the theme

  • Open qt5ct

  • Pick Kvantum dark

  • Confirm Catppuccin-Mocha as the color palette

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

Clone this wiki locally