This article was machine-translated from the Japanese version.


Installing Hyprland as a compositor for Arch Linux
Note that what a compositor is, features of Hyprland, and comparisons with other compositors etc. are omitted here

Installing Hyprland

Install according to Installation – Hyprland Wiki
Since installing on Arch Linux here, run the following command

sudo pacman -S hyprland

Installing Fonts

Hyprland uses sans-serif or noto-fonts as the default configuration font, so install it beforehand

sudo pacman -S noto-fonts

Adding a Startup Script for uwsm

There is also a method to launch Hyprland directly, but this time it will be launched using uwsm
Install the required packages according to Systemd startup – Hyprland Wiki

pacman -S uwsm libnewt

Then, append the following script to an appropriate file
Here, it is appended to ~/.profile

if uwsm check may-start && uwsm select; then
	exec uwsm start default
fi

Warning
Here, appending the startup script to a file such as ~/.bash_profile that is automatically loaded at login makes it difficult to return to the CUI screen when problems occur
Therefore, during the installation phase, it is preferable to append it to a file that is not automatically loaded, and transfer it to ~/.bash_profile etc. after all work is completed

Starting Hyprland

Start with the following command and confirm that the first-time launch screen is displayed

source ~/.profile

Notice
At this time, do not log in from the root user with sudo su - USER and execute the command; log in directly as USER
Logging in via su does not set the necessary environment variables, causing the following error

[CRITICAL] Critical error thrown: XDG_RUNTIME_DIR is not set!  
terminate called after throwing an instance of 'std::runtime_error'  
  what():  XDG_RUNTIME_DIR is not set!  
Aborted (core dumped)  

Installing Required Packages

If you choose to run the tutorial on the first-time launch screen, you will be guided to install required or nearly required packages, so install the packages you want to use with sudo pacman -S according to Useful Utilities – Hyprland Wiki

Here, the packages installed in this session are listed
To return to the CUI screen, press SUPER+M to return to the login screen

  • Notification Daemon
    • dunst
  • Audio and Video Handling
    • pipewire
    • wireplumber
    • pipewire-pulse
    • pipewire-alsa
  • XDG Desktop Portal
    • xdg-desktop-portal-hyprland
  • Authentication Agent
    • hyprpolkitagent
      • Launching requires appending exec-once = systemctl --user start hyprpolkitagent in ~/.config/hypr/hyprland.conf
      • When launching via uwsm, executing systemctl --user enable --now hyprpolkitagent.service from the CUI screen can be used instead of appending the configuration
  • Status Bar
    • waybar
      • Launching requires appending exec-once = waybar in ~/.config/hypr/hyprland.conf
      • When launching via uwsm, executing systemctl --user enable --now waybar.service from the CUI screen can be used instead of appending the configuration
  • Wallpaper
    • hyprpaper
      • Launching requires appending exec-once = hyprpaper in ~/.config/hypr/hyprland.conf
  • App launchers
    • rofi
  • Clipboard Managers
    • cliphist
      • Launching requires appending exec-once = wl-paste --type text --watch cliphist store and exec-once = wl-paste --type image --watch cliphist store in ~/.config/hypr/hyprland.conf
  • File Managers
    • thunar
  • Terminal
    • kitty

After installing the required packages, Hyprland becomes available

Transferring the Startup Script to the Profile File

To automatically start Hyprland at login, transfer the content appended to ~/.profile in Adding a Startup Script for uwsm to a file that is automatically loaded such as ~/.bash_profile

cat ~/.profile >> ~/.bash_profile
rm ~/.profile

References