hyprland-wiki/pages/Getting Started/Installation.md
Jan Beich 6084a2bea7 Installation: drop GCC dependency on FreeBSD
System tomlplusplus is built against libc++ which conflicts with
libstdc++ used by GCC. While tomlplusplus can be bundled it's only
easy to do via Meson (--force-fallback-for).

/usr/local/bin/ld: hyprpm/CMakeFiles/hyprpm.dir/src/core/DataState.cpp.o: in function `DataState::addNewPluginRepo(SPluginRepository const&)':
DataState.cpp:(.text+0x16b4): undefined reference to `toml::v3::table::get_lower_bound(std::basic_string_view<char, std::char_traits<char> >)'
/usr/local/bin/ld: DataState.cpp:(.text+0x1793): undefined reference to `toml::v3::table::insert_with_hint(toml::v3::impl::table_iterator<true>, toml::v3::key&&, std::unique_ptr<toml::v3::node, std::default_delete<toml::v3::node> >&&)'
/usr/local/bin/ld: DataState.cpp:(.text+0x2c59): undefined reference to `toml::v3::impl::print_to_stream(std::ostream&, toml::v3::table const&)'
/usr/local/bin/ld: hyprpm/CMakeFiles/hyprpm.dir/src/core/DataState.cpp.o: in function `DataState::pluginRepoExists(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
DataState.cpp:(.text+0x3739): undefined reference to `toml::v3::ex::parse_file(std::basic_string_view<char, std::char_traits<char> >)'
/usr/local/bin/ld: DataState.cpp:(.text+0x3783): undefined reference to `toml::v3::table::get(std::basic_string_view<char, std::char_traits<char> >)'
/usr/local/bin/ld: DataState.cpp:(.text+0x37ab): undefined reference to `toml::v3::table::get(std::basic_string_view<char, std::char_traits<char> >)'
[...]
2024-09-21 16:02:32 +02:00

15 KiB

weight title
1 Installation

{{< callout type=warning >}}

Due to their proprietary nature, Nvidia GPUs have limited compatibility with Hyprland. If you want to try Hyprland on Nvidia regardless (many people have reported successes), follow the Nvidia page after installing Hyprland.

{{< /callout >}}

Distros

Arch, NixOS and openSUSE Tumbleweed are very supported. For any other distro (not based on Arch/Nix) you might have varying amounts of success. However, since Hyprland is extremely bleeding-edge, distros like Pop!_OS, Ubuntu, etc. might have major issues running Hyprland.

Installation

Installing Hyprland is very easy. Simply install it with your package manager (if there is a Hyprland package available) or install/build it yourself.

{{< callout >}}

This project is under development and is constantly changing. If you want to keep up to date with the latest commits, please consider updating your packages with yay -Syu --devel, or your preferred package manager.

{{< /callout >}}

Packages

WARNING: I do not maintain any packages. If they are broken, try building from source first.

{{% details title="Arch" closed="true" %}}

Install from the AUR, which compiles the latest source:

yay -S hyprland-git

or a tagged release from the arch packages:

sudo pacman -S hyprland

If you decide to use the git version from the AUR, you can use the Chaotic Aur to get pre-built binaries.

In case of errors you can downgrade easily with downgrade.

{{% /details %}}

{{% details title="Nix" closed="true" %}}

Enable Hyprland in your NixOS configuration:

programs.hyprland.enable = true;

For more details, read the Nix page.

{{% /details %}}

{{% details title="openSUSE*" closed="true" %}}

Hyprland is part of factory, starting with snapshot 20230411. To install it simply use zypper

sudo zypper in hyprland

or install the "hyprland" package via YaST2 Software.

For hyprpm to recognize it's dependencies, you'll also need to install hyprland-devel:

sudo zypper in hyprland-devel

Alternatively, you can also follow the instructions under "Manual (Manual Build)" to build Hyprland yourself.

Note: Hyprland is not available for Leap, as most libraries (and compiler) that Hyprland needs are too old.

{{% /details %}}

{{% details title="Fedora*" closed="true" %}}

On Fedora 39+, run:

sudo dnf install hyprland
sudo dnf install hyprland-devel # If you want to build plugins (use hyprpm)

Faster updates and additional packages are available in the solopasha/hyprland Copr repository.

If you are on an older version of Fedora, you can also compile it yourself by following the instructions here

{{% /details %}} {{% details title="Debian*" closed="true" %}}

Hyprland recently made it into the SID and trixie repos and can be installed with

sudo apt install hyprland

Note: Even though Hyprland is in the trixie repos, it is still recommended to install from SID, as some dependencies in the trixie repo are outdated.

Alternatively, you can also follow the instructions under "Manual (Manual Build)" to build Hyprland yourself.

{{< callout type=info >}}

Hyprland is not available for Bookworm as its packages are too old.

{{< /callout >}}

{{% /details %}}

{{% details title="Gentoo*" closed="true" %}}

The hyprland package is available in the main tree:

emerge --ask gui-wm/hyprland

Additional packages like hyprlock, hypridle, xdg-desktop-portal-hyprland, hyprland-plugins, hyprpaper and hyprpicker are available in the GURU overlay. Community-contributed scripts are also available in GURU as part of the hyprland-contrib package.

eselect repository enable guru
emaint sync -r guru

emerge --ask gui-apps/hyprlock
emerge --ask gui-apps/hypridle
emerge --ask gui-libs/xdg-desktop-portal-hyprland
emerge --ask gui-apps/hyprland-plugins
emerge --ask gui-apps/hyprpaper
emerge --ask gui-apps/hyprpicker
emerge --ask gui-wm/hyprland-contrib

For USE flags and more details, read the Gentoo wiki page about Hyprland.

{{% /details %}}

{{% details title="FreeBSD*" closed="true" %}}

Hyprland and related are in the default repository:

{{% /details %}}

{{% details title="Ubuntu*" closed="true" %}}

Hyprland made it into the universe repos and can be installed with

sudo add-apt-repository universe && sudo apt-get update && sudo apt-get install -y hyprland

Build dependencies:

sudo apt-get install -y meson wget build-essential ninja-build cmake-extras cmake gettext gettext-base fontconfig libfontconfig-dev libffi-dev libxml2-dev libdrm-dev libxkbcommon-x11-dev libxkbregistry-dev libxkbcommon-dev libpixman-1-dev libudev-dev libseat-dev seatd libxcb-dri3-dev libegl-dev libgles2 libegl1-mesa-dev glslang-tools libinput-bin libinput-dev libxcb-composite0-dev libavutil-dev libavcodec-dev libavformat-dev libxcb-ewmh2 libxcb-ewmh-dev libxcb-present-dev libxcb-icccm4-dev libxcb-render-util0-dev libxcb-res0-dev libxcb-xinput-dev xdg-desktop-portal-wlr libtomlplusplus3

you will also need to build the latest wayland, wayland-protocols, and libdisplay-info tagged releases from source

for more info refer to the Ubuntu Guide For Installing And Building Hyprland Gist

{{< callout type=warning >}}

Please note that since Ubuntu is generally behind with dependencies, it's not guaranteed that the build process will work at all. Even if it is, it's likely that it will break at some point in the future.

{{< callout >}}

Always use the latest version of Ubuntu for the most up to date dependencies.

Note: Your mileage may vary, as GDM has some bugs with Hyprland. Check the Master Tutorial for more info.

{{< /callout >}}

Refer to the gist if anything fails.

{{< /callout >}}

{{% /details %}}

{{% details title="Void Linux*" closed="true" %}}

Hyprland is not available from Void Linux's official repositories due to a conflict of packaging philosophy. However, a third party repository is available with binary packages built in CI by GitHub Actions.

You can add this repository by creating a file such as /etc/xbps.d/hyprland-void.conf with the following contents:

repository=https://raw.githubusercontent.com/Makrennel/hyprland-void/repository-x86_64-glibc

Then you can install the packages as you would any other:

sudo xbps-install -S hyprland
sudo xbps-install -S hyprland-devel # If you want to use plugins
sudo xbps-install -S xdg-desktop-portal-hyprland

xbps-query -Rs hypr # This will require you to have already accepted the repository's fingerprint using xbps-install -S

More information is available in the hyprland-void README, including information about how you can manually build Hyprland for Void Linux using the templates provided.

{{% /details %}}

{{% details title="Slackware*" closed="true" %}}

hyprland-bin (SlackBuilds) - Prebuilt release for Slackware ready for install

Hyprland is not installed by default on the current release of Slackware.

For detailed instructions on installing this build see here

{{% /details %}}

{{% details title="Alpine*" closed="true" %}}

Hyprland is available in Alpine's testing repository which can be enabled in /etc/apk/repositories by adding

http://dl-cdn.alpinelinux.org/alpine/edge/testing

This will only work on Alpine linux edge, not on any stable release. For use on stable releases, see the Alpine wiki

After enabling the repository, the following command will install hyprland and its dependencies.

apk add hyprland

{{% /details %}}

* Unofficial, no official support is provided. These instructions are community-driven, and no guarantee is provided for their validity.

Manual (Releases, Linux-only)

  1. Download the most recent release.
  2. copy the binaries (Hyprland, hyprctl, hyprpm) to /usr/bin/.
  3. copy the desktop entry (example/hyprland.desktop) to /usr/share/wayland-sessions/

the example config is in example/hyprland.conf.

For updating later on, you can overwrite the binaries (Hyprland, hyprctl, hyprpm) . You don't need to update anything else.

Manual (Manual Build)

Dependencies:

{{< callout type=info >}}

Please note that Hyprland uses the C++26 standard, so both your compiler and your C++ standard library has to support that (gcc>=14 or clang>=18).

{{< /callout >}}

{{% details title="Arch" closed="true" %}}

yay -S gdb ninja gcc cmake meson libxcb xcb-proto xcb-util xcb-util-keysyms libxfixes libx11 libxcomposite xorg-xinput libxrender pixman wayland-protocols cairo pango seatd libxkbcommon xcb-util-wm xorg-xwayland libinput libliftoff libdisplay-info cpio tomlplusplus hyprlang hyprcursor hyprwayland-scanner xcb-util-errors hyprutils-git

(Please make a pull request or open an issue if any packages are missing from the list)

{{% /details %}}

{{% details title="OpenSuse" closed="true" %}}

zypper in gcc-c++ git meson cmake "pkgconfig(cairo)" "pkgconfig(egl)" "pkgconfig(gbm)" "pkgconfig(gl)" "pkgconfig(glesv2)" "pkgconfig(libdrm)" "pkgconfig(libinput)" "pkgconfig(libseat)" "pkgconfig(libudev)" "pkgconfig(pango)" "pkgconfig(pangocairo)" "pkgconfig(pixman-1)" "pkgconfig(vulkan)" "pkgconfig(wayland-client)" "pkgconfig(wayland-protocols)" "pkgconfig(wayland-scanner)" "pkgconfig(wayland-server)" "pkgconfig(xcb)" "pkgconfig(xcb-icccm)" "pkgconfig(xcb-renderutil)" "pkgconfig(xkbcommon)" "pkgconfig(xwayland)" "pkgconfig(xcb-errors)" glslang-devel Mesa-libGLESv3-devel tomlplusplus-devel

(this should also work on RHEL/Fedora if you remove Mesa-libGLESv3-devel and pkgconfig(xcb-errors))

{{% /details %}}

{{% details title="FreeBSD" closed="true" %}}

pkg install git pkgconf gmake evdev-proto cmake wayland-protocols wayland libglvnd libxkbcommon libinput cairo pango pixman tomlplusplus libxcb
pkg install meson jq hwdata

{{% /details %}}

{{% details title="Ubuntu" closed="true" %}}

refer to the Ubuntu tab above

Please note that Hyprland uses the C++23 standard, so both your compiler and your C++ library has to support that (gcc>=13.0.0 or clang>=15). On Clang-based systems libc++ may be used by default, so until libc++ supports C++23 you have to pass -stdlib=libstdc++ or switch to GCC.

{{% /details %}}

{{< callout type=warning >}}

Additionally to those, you will also need a few hypr* dependencies which may or may not be packaged for your distro of choice:

  • aquamarine
  • hyprlang
  • hyprcursor
  • hyprwayland-scanner (build-only)

{{< /callout >}}

git clone --recursive https://github.com/hyprwm/Hyprland
cd Hyprland
make all && sudo make install

CMake is always recommended as it's the intended way Hyprland should be installed.

Meson

git clone --recursive https://github.com/hyprwm/Hyprland
cd Hyprland
meson setup build
meson compile -C build
meson install -C build --skip-subprojects

Refer to Debugging to see how to build & debug.

Crash on launch

See Crashes and Bugs.

Custom installation (legacy renderer, etc)

  1. cd into the hyprland repo.
  2. for legacy renderer:
make legacyrenderer
sudo make install

{{< callout type=info >}}

please note the legacy renderer may not support some graphical features.

{{< /callout >}}

  1. Any other config: (replace <PRESET> with your preset: release, debug, legacyrenderer, legacyrendererdebug)
make <PRESET> && sudo cp ./build/Hyprland /usr/bin && sudo cp ./example/hyprland.desktop /usr/share/wayland-sessions

Custom Build flags

To apply custom build flags, you'll have to ditch make.

Supported custom build flags:

LEGACY_RENDERER - Compiles with the legacy renderer (see above)
NO_XWAYLAND - Removes XWayland support
NO_SYSTEMD - Removes systemd dependencies

Flags can be passed to CMake like this:

cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -D<FLAG>:STRING=true -B build -G Ninja

Change <FLAG> to one of the custom build flags. Multiple flags can be used at once, by adding more -D<FLAG_2>:STRING=true.

The BUILD_TYPE can also be changed to Debug.

To build, run:

cmake --build ./build --config Release --target all

If you configured in Debug, change the --config to Debug as well.

To install, run:

sudo cmake --install ./build

Running In a VM

YMMV, this is not officially supported.

Read through the libvirt Arch wiki page and get libvirt, virsh, and virt-viewer setup and installed.

# Install libvirt and qemu things.
sudo pacman -S libvirt virt-viewer qemu-common
# Add yourself to the libvirt group.
sudo usermod -a -G libvirt USER # Replace 'USER' with your username.
# Enable and start libvirtd.
systemctl enable --now libvirtd

Go to the arch-boxes gitlab and download the latest arch qemu basic image. You can also download via any of arch's mirrors.

curl https://geo.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-basic.qcow2 \
  -o ~/Downloads/arch-qemu.qcow2 # Or download wherever you want.

Create the VM with virsh.

# Use virt-install (included with libvirt) to install the vm from the image.
virt-install \
  --graphics spice,listen=none,gl.enable=yes,rendernode=/dev/dri/renderD128 \
  --name hypr-vm \
  --os-variant archlinux \
  --memory 2048 \
  --disk ~/Downloads/arch-qemu.qcow2 \
  --import

Connect with virt-viewer, this will open a virt-viewer graphical session on the tty. The default login is 'arch' for user and 'arch' for password.

{{< callout >}}

Make sure the --attach flag is used, enabling virgl makes it so that we had to disable listen. This means that we can't make a direct TCP/UNIX socket connection to the remote display. --attach asks libvirt to provide a pre-connected socket to the display.*

{{</ callout >}}

virt-viewer --attach hypr-vm

Finally on the guest follow the instructions above for either installing hyprland-git from the aur or building manually. {{< callout >}}

Make sure you install mesa as the OpenGL driver. The virgl drivers are included in mesa.

{{</ callout >}}