Skip to content

Instantly share code, notes, and snippets.

@zeromero-dev
Last active June 26, 2024 22:13
Show Gist options
  • Save zeromero-dev/c33bfa7ef2813acc93fbf37f5545db73 to your computer and use it in GitHub Desktop.
Save zeromero-dev/c33bfa7ef2813acc93fbf37f5545db73 to your computer and use it in GitHub Desktop.
Hyprland install on arch

Optional

Install yay (if pacman doesn't see hyprland)
pacman -S --needed git base-devel && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si

Install these dependenice to be able to run hyprland

yay -S swaybg swayidle swaylock wlroots wl-clipboard waybar wofi foot mako grim slurp wf-recorder light yad thunar geany mpv mpd mpc viewnior imagemagick xfce-polkit xorg-xwayland xdg-desktop-portal-wlr

Install hyprland

yay -S hyprland

Config

If you want to test hyprland work just log out of your system and boot with Hyperland (Wayland) environment in your login manager. It'll automaticly create an example config with kitty terminal. So install it yay -S kitty if you don't have one. But if you want to load with custom config and change some things after installation of hyprland you need to:

  • mkdir -p ~/.config/hypr
  • touch ~/.config/hypr/hyprland.conf && nano hyprland.conf

NVIDIA tweaks

Install the nvidia-dkms driver and add it to your initramfs & kernel parameters. Follow the information available here: https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting
In /etc/mkinitcpio.conf add nvidia nvidia_modeset nvidia_uvm nvidia_drm to your MODULES

run # mkinitcpio --config /etc/mkinitcpio.conf --generate /boot/initramfs-custom.img

add a new line to /etc/modprobe.d/nvidia.conf (make it if it does not exist) and add the line options nvidia-drm modeset=1

Make an executable file somewhere in your PATH, for example ~/.local/bin/, called (for example) wrappedhl. In it put:

#!/bin/sh

cd ~

export _JAVA_AWT_WM_NONREPARENTING=1
export XCURSOR_SIZE=24
export LIBVA_DRIVER_NAME=nvidia
export XDG_SESSION_TYPE=wayland
export GBM_BACKEND=nvidia-drm
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export WLR_NO_HARDWARE_CURSORS=1
exec Hyprland

You can add as many exported envvars as you need (Nvidia users might need a lot), but it’s recommended to have at least the shown two.

  • Install qt5-wayland, qt5ct and libva. Additionally nvidia-vaapi-driver-git (AUR) to fix crashes in some Electron-based applications, such as Unity Hub. Reboot your computer

Launch Hyprland with the wrapper - in your windows manager Shift + Alt + F3, locate you exec an run it with bash wrappedhl

You should now launch Hyprland with wrappedhl instead of Hyprland. Make sure to copy your .desktop file in /usr/share/wayland-sessions/ and edit it if you use a login manager! You might need to put the full path in it, as login managers are usually not ran through the user account.

It should work now.

General tips for newcomers

SUPER key = windows key by default
SUPER + M = exit hyprland
SUPER + Q = open terminal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment