Hypr Libraries

Introduction to Hypr Libraries

The Hypr libraries provide needed utilties for the entire Hypr ecosystem. While two of the packages installed in this page are not strictly required (hyprland-qt-support and hyprland-qtutils), they are needed for some dialog boxes and this book assumes that you have built them.

[Important]

Important

Updating this package is known to break ABI.

[Note]

Note

This may take a while to build. Feel free to do something else while this is building.

Package Information

Hypr Libraries Dependencies

Required

Cairo, CMake, libdisplay-info, libdrm, libinput, libjxl, librsvg, libspng-0.7.4, libwebp, libzip-1.11.3, Mesa, Pixman, pugixml-1.15, Qt-6, seatd, tomlplusplus-3.4.0, Wayland, and Wayland-Protocols

Recommended

Downloading Hypr Libraries

First create a list of files to be downloaded:

cat > hypr-list << "EOF"
hyprland-protocols/archive/v0.6.2/hyprland-protocols-v0.6.2.tar.gz
hyprutils/archive/v0.5.0/hyprutils-v0.5.0.tar.gz
hyprlang/archive/v0.6.0/hyprlang-v0.6.0.tar.gz
hyprcursor/archive/v0.1.11/hyprcursor-v0.1.11.tar.gz
hyprwayland-scanner/archive/v0.4.4/hyprwayland-scanner-v0.4.4.tar.gz
aquamarine/archive/v0.7.2/aquamarine-v0.7.2.tar.gz
hyprgraphics/archive/v0.1.2/hyprgraphics-v0.1.2.tar.gz
hyprland-qt-support/archive/v0.1.0/hyprland-qt-support-v0.1.0.tar.gz
hyprland-qtutils/archive/v0.1.3/hyprland-qtutils-v0.1.3.tar.gz
EOF

To download the needed files using Wget, use the following commands:

mkdir hyprlib &&
cd    hyprlib &&
grep -v '^#' ../hypr-list | wget -i- -c \
    -B https://github.com/hyprwm/

Installation of Hypr Libraries

First, IF you have not followed the KDE Frameworks 6 Pre-installation Configuration and have not configured KDE to install in /usr, add to /etc/profile.d/qt6.sh to ensure QML files can be loaded/imported as the root user:

cat >> /etc/profile.d/qt6.sh << "EOF"
# Begin Hypr extension for /etc/profile.d/qt6.sh

pathappend /usr/lib/plugins        QT_PLUGIN_PATH
pathappend $QT6DIR/lib/plugins     QT_PLUGIN_PATH

pathappend /usr/lib/qt6/qml        QML2_IMPORT_PATH
pathappend $QT6DIR/lib/qml         QML2_IMPORT_PATH

# End extension for /etc/profile.d/qt6.sh
EOF

Now go ahead and source the startup script again:

source /etc/profile.d/qt6.sh
[Note]

Note

When installing multiple packages in a script, the installation needs to be done as the root user. There are three general options that can be used to do this:

  1. Run the entire script as the root user (not recommended).

  2. Use the sudo command from the sudo package.

  3. Use su -c "command arguments" (quotes required) which will ask for the root password for every iteration of the loop.

One way to handle this situation is to create a short bash function that automatically selects the appropriate method. Once the command is set in the environment, it does not need to be set again.

as_root()
{
  if   [ $EUID = 0 ];        then $*
  elif [ -x /usr/bin/sudo ]; then sudo $*
  else                            su -c \\"$*\\"
  fi
}

export -f as_root

Next, start a subshell that will exit on error:

bash -e

Install all the packages by running the following commands:

for package in $(grep -v '^#' ../hypr-list)
do
package=$(basename "$package")
packagedir=${package%.tar.?z*}
packagedir=$(echo -n "$packagedir" | sed 's/-v\([0-9]\)/-\1/')
echo "Building $packagedir"

  tar -xf $package
  pushd $packagedir

  case $packagedir in
    hyprland-protocols-[0-9]* )
      mkdir build
      cd build
        meson setup --prefix=/usr ..
    ;;

    aquamarine-[0-9]* )
      sed -i 's/OpenGL::OpenGL/OpenGL::GL/g' \
          CMakeLists.txt
      mkdir build
      cd    build
        cmake -D CMAKE_INSTALL_PREFIX=/usr       \
              -D CMAKE_BUILD_TYPE=Release        \
              -D CMAKE_SKIP_INSTALL_RPATH=ON     \
              -G Ninja ..
    ;;

    hyprland-qt-support-[0-9]* )
      mkdir build
      cd    build
        cmake -D CMAKE_INSTALL_PREFIX=/usr       \
              -D CMAKE_BUILD_TYPE=Release        \
              -D CMAKE_SKIP_INSTALL_RPATH=ON     \
              -D INSTALL_QML_PREFIX=/lib/qt6/qml \
              ..
        make

        as_root make install
      popd     # $packagedir
      rm -rf $packagedir
      as_root /sbin/ldconfig
      continue # for loop
    ;;

    * )
      mkdir build
      cd    build
        cmake -D CMAKE_INSTALL_PREFIX=/usr   \
              -D CMAKE_BUILD_TYPE=Release    \
              -D CMAKE_SKIP_INSTALL_RPATH=ON \
              -G Ninja ..
    ;;
  esac

  ninja
  as_root ninja install
  popd
  rm -rf $packagedir
  as_root /sbin/ldconfig
done

Finally, exit the shell that was started earlier:

exit

Command Explanations

-D CMAKE_SKIP_INSTALL_RPATH=ON: This switch makes cmake remove hardcoded library search paths (rpath) when installing a binary executable file or a shared library. This package does not need rpath once it's installed into the standard location, and rpath may sometimes cause unwanted effects or even security issues.

Contents

Installed Programs: hyprcursor-util, hyprland-dialog, hyprland-donate-screen, hyprland-update-screen, and hyprwayland-scanner
Installed Libraries: libaquamarine.so, libhyprcursor.so, libhyprgraphics.so, libhyprland-quick-style-implplugin.so, libhyprland-quick-style-impl.so, libhyprland-quick-styleplugin.so, libhyprland-quick-style.so, libhyprlang.so, and libhyprutils.so
Installed Directories: /usr/include/{aquamarine,hyprcursor,hyprgraphics,hyprutils}, /usr/lib/cmake/hyprwayland-scanner, /usr/lib/qt6/qml/org/hyprland/style, and /usr/share/hyprland-protocols

Short Descriptions

hyprcursor-util

compiles, packs, and unpacks hyprcursor and xcursor themes

hyprland-dialog

shows certain dialog using Qt-6

hyprland-donate-screen

shows a pop up box telling users to donate using Qt-6

hyprland-update-screen

shows a pop up box telling users to update using Qt-6

hyprwayland-scanner

generates C++ code from Wayland protocol XML files

libaquamarine.so

provides rendering backend API functions

libhyprcursor.so

provides API functions for the hyprcursor format

libhyprgraphics.so

provides graphics utility functions for the Hypr ecosystem

libhyprland-quick-style-implplugin.so

is the Hyprland Quick Style IMPL plugin

libhyprland-quick-style-impl.so

is the Hyprland Quick Style IMPL library

libhyprland-quick-styleplugin.so

is the Hyprland Quick Style plugin

libhyprland-quick-style.so

is the Hyprland Quick Style library

libhyprlang.so

provides functions to parse and use the Hypr configurartion language

libhyprutils.so

provides utility functions for the Hypr ecoysystem