Skip to content

Instantly share code, notes, and snippets.

@clementpoiret
Last active April 23, 2024 09:50
Show Gist options
  • Save clementpoiret/992d7b4c8cd3707b21461366c817db4d to your computer and use it in GitHub Desktop.
Save clementpoiret/992d7b4c8cd3707b21461366c817db4d to your computer and use it in GitHub Desktop.
hyprland-displaylink-git
# Maintainer: Clément POIRET <poiret dot clement at outlook dot fr>
_pkgname="hyprland"
pkgname="${_pkgname}-displaylink-git"
pkgver="0.38.1"
pkgrel=1
pkgdesc="A dynamic tiling Wayland compositor based on wlroots that doesn't sacrifice on its looks. (DisplayLink patch)"
arch=(any)
url="https://github.com/hyprwm/Hyprland"
license=('BSD')
depends=(
cairo
gcc-libs
glib2
glibc
glslang
hyprlang
hyprcursor
libdisplay-info
libdrm
libglvnd
libinput
libliftoff
libx11
libxcb
libxcomposite
libxfixes
libxkbcommon
libxrender
opengl-driver
pango
pixman
polkit
seatd
systemd-libs
tomlplusplus
wayland
wayland-protocols
xcb-proto
xcb-util
xcb-util-errors
xcb-util-keysyms
xcb-util-renderutil
xcb-util-wm
xorg-xinput
xorg-xwayland
)
depends+=(libdisplay-info.so)
makedepends=(
cmake
gdb
git
jq
meson
ninja
pkgconf
xorgproto
)
source=(
"${pkgname}-${pkgver}.tar.gz::https://github.com/hyprwm/Hyprland/releases/download/v${pkgver}/source-v${pkgver}.tar.gz"
"displaylink.patch"
)
conflicts=("${_pkgname}")
provides=(hyprland)
sha256sums=('1a86365cc006fca4bc96c6c41347d0bde048b6463c516e09b9c54cff58fb73ab'
'70c8f6af41ed252c2cee7b1fc0b29ff29c7f81932a9dd3014716571b0728e5ab')
options=(!makeflags !buildflags !strip)
prepare() {
cd "$srcdir/hyprland-source"
patch -d subprojects/wlroots -Np1 < ../displaylink.patch
}
build() {
cd "$srcdir/hyprland-source"
meson setup build \
--prefix /usr \
--libexecdir lib \
--sbindir bin \
--buildtype release \
--wrap-mode nodownload \
-D b_lto=true \
-D b_pie=true \
-D default_library=shared \
-D xwayland=enabled \
-D systemd=enabled
meson compile -C build
}
package() {
cd "$srcdir/hyprland-source"
meson install -C build \
--destdir "$pkgdir" \
--skip-subprojects hyprland-protocols
mkdir "$pkgdir/usr/include/hyprland/wlroots"
mv "$pkgdir/usr/include/wlr" "$pkgdir/usr/include/hyprland/wlroots"
# resolve conflicts with system wlr
rm -f "$pkgdir/usr/lib/libwlroots.so"
rm -rf "$pkgdir/usr/lib/pkgconfig"
# FIXME: remove after xdg-desktop-portal-hyprland disowns hyprland-portals.conf
rm -rf "$pkgdir/usr/share/xdg-desktop-portal"
# license
install -Dm0644 -t "$pkgdir/usr/share/licenses/${pkgname}" LICENSE
}
@GersiD
Copy link

GersiD commented Mar 21, 2024

Hi I've noticed you in alot of the display link forums related to hyprland. Thank you for all your questions and advice to others. I would like to use this pkgbuild script since I'm running endevour OS. But is it as simple as Cloning this file and running makepkg PKGBUILD?

@clementpoiret
Copy link
Author

@GersiD Thanks for your message, it reminded me to update the PKGBUILD to hyprland 0.37.1!

Steps to install hyprland with displaylink patch:
0. Due to recent changes in dependencies, you need to install hyprcusor manually (yay -S hyprcursor). Because it relies on newer versions of hyprlang, I also had to replace xdg-desktop-portal, hyprlang, and hyprpaper with xdg-desktop-portal-git, hyprlang-git, and hyprpaper-git.

  1. Ensure you have displaylink (currently v5.8-1 for me) and evdi (I use evdi-git).
  2. Download both PKGBUILD and displaylink.patch and place them in the same directory.
  3. cd to this directory containing the two files and simply call makepkg -si.

You now have hyprland v0.37.1 installed, simply reboot and check that your screen works!

@clementpoiret
Copy link
Author

Disclaimer: the displaylink patch is not mine, it comes from https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1823 from matt1606.

@clementpoiret
Copy link
Author

Updated to v0.38.1

@dvrkoo
Copy link

dvrkoo commented Apr 17, 2024

Hey thanks for the gist, for me it is failing while validity checking displayllink.patch
edit: managed to install it by updating pkg checksum but the displaylink display is still not working, I'm on nvidia btw

@clementpoiret
Copy link
Author

Hey @dvrkoo thanks for your feedback!
Oops, I made a mistake concerning the hash. I just updated it, it should be okay now.

@dvrkoo
Copy link

dvrkoo commented Apr 18, 2024

hey thx, it install without having to update the checksum manually now, still not working doe, hyprctl monitors all lists displaylink monitor but monitor is not working when added to config, I just get blackscreen

`
Monitor DP-3 (ID 0):
2560x1440@165.00301 at 0x0
description: ASUSTek COMPUTER INC VG27AQ1A R6LMQS052577
make: ASUSTek COMPUTER INC
model: VG27AQ1A
serial: R6LMQS052577
active workspace: 1 (1)
special workspace: 0 ()
reserved: 0 0 0 32
scale: 1.00
transform: 0
focused: yes
dpmsStatus: 1
vrr: 0
activelyTearing: false
currentFormat: XBGR2101010
availableModes: 2560x1440@165.00Hz 2560x1440@144.01Hz 2560x1440@120.00Hz 2560x1440@99.95Hz 2560x1440@59.95Hz 1920x1080@119.88Hz 1920x1080@100.00Hz 1920x1080@60.00Hz 1920x1080@59.94Hz 1920x1080@50.00Hz 1280x1024@75.03Hz 1280x1024@60.02Hz 1440x900@59.89Hz 1152x864@75.00Hz 1280x720@59.94Hz 1280x720@50.00Hz 1440x576@50.00Hz 1024x768@75.03Hz 1024x768@70.07Hz 1024x768@60.00Hz 1440x480@59.94Hz 800x600@75.00Hz 800x600@72.19Hz 800x600@60.32Hz 800x600@56.25Hz 720x576@50.00Hz 640x480@75.00Hz 640x480@72.81Hz 640x480@59.94Hz

Monitor DVI-I-1 (ID 1):
1920x1080@60.00000 at 2560x0
description: ASUSTek COMPUTER INC MB16A R2LMQS066582
make: ASUSTek COMPUTER INC
model: MB16A
serial: R2LMQS066582
active workspace: 2 (2)
special workspace: 0 ()
reserved: 0 0 0 31
scale: 1.50
transform: 0
focused: no
dpmsStatus: 1
vrr: 0
activelyTearing: false
currentFormat: XRGB8888
availableModes: 1920x1080@60.00Hz 1600x1200@60.00Hz 1680x1050@59.88Hz 1280x1024@60.02Hz 1440x900@59.90Hz 1280x960@60.00Hz 1280x800@59.91Hz 1280x720@60.00Hz 1024x768@60.00Hz 800x600@60.32Hz 640x480@59.94Hz
`
here's my hyprctl output, I'm on nvidia 550.67 if that matters

@clementpoiret
Copy link
Author

Okay, so now your hyprland setup works. I would say you may want to try few things:

  1. instead of the evdi package, try evdi-git or evdi-compat,
  2. try the same setup with and lts kernel,

Also, regularly nvidia drivers are breaking things. If you do not use your GPU, I'd suggest trying the nouveau driver. For my personal workflow, nouveau suits my needs on my laptop as I do not use CUDA and cuDNN on it. At least, if you try the nouveau driver and see that your screen is working, it means that's effectively an issue with nvidia, so you can try to temporarily downgrade your nvidia drivers. I got tired of nvidia breaking things randomly so I gave up and went the nouveau path :)

@dvrkoo
Copy link

dvrkoo commented Apr 23, 2024

Already tried using evdi-git and using lts kernel , unfortunately my workflow relies heavily on CUDA so I cannot really live without it, I'm just gonna stick with x11 in the meanwhile, thanks for your work

@clementpoiret
Copy link
Author

Hopefully one day this patch will be merged into wlroots, let's cross our fingers :)

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