From 18f095cb2315861a7b2ff8a2ec6baf5bcd43e74e Mon Sep 17 00:00:00 2001 From: "Oscar R." <108957859+mesteryui@users.noreply.github.com> Date: Tue, 30 Dec 2025 17:20:33 +0100 Subject: [PATCH] feat: implement smart compositor entry point (start-hyprland vs Hyprland) (#1211) * Adding a way to use the start-hyprland wrapper when it's needed from Hyprland 0.53 it's recommended because offers more security if happens a fail * Deleting unnecessary things and doing verifications * fix pre-commit --------- Co-authored-by: bbedward --- quickshell/Modules/Greetd/assets/dms-greeter | 8 +++++++- quickshell/Modules/Greetd/assets/greet-hyprland.sh | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/quickshell/Modules/Greetd/assets/dms-greeter b/quickshell/Modules/Greetd/assets/dms-greeter index 4e6698cc..01eadd9d 100755 --- a/quickshell/Modules/Greetd/assets/dms-greeter +++ b/quickshell/Modules/Greetd/assets/dms-greeter @@ -186,7 +186,13 @@ exec = sh -c "$QS_CMD; hyprctl dispatch exit" HYPRLAND_EOF COMPOSITOR_CONFIG="$TEMP_CONFIG" fi - exec Hyprland -c "$COMPOSITOR_CONFIG" + CURRENT_VERSION=$(hyprctl version | grep "Tag:" | awk '{print $2}' | tr -d 'v,') + MINIMUM_VERSION="0.53.0" + if [ "$(printf '%s\n%s' "$MINIMUM_VERSION" "$CURRENT_VERSION" | sort -V | head -n1)" = "$MINIMUM_VERSION" ]; then + exec start-hyprland -- --config "$COMPOSITOR_CONFIG" + else + exec Hyprland -c "$COMPOSITOR_CONFIG" + fi ;; sway) diff --git a/quickshell/Modules/Greetd/assets/greet-hyprland.sh b/quickshell/Modules/Greetd/assets/greet-hyprland.sh index e3ee18d2..864aa5d1 100755 --- a/quickshell/Modules/Greetd/assets/greet-hyprland.sh +++ b/quickshell/Modules/Greetd/assets/greet-hyprland.sh @@ -4,5 +4,12 @@ export XDG_SESSION_TYPE=wayland export QT_QPA_PLATFORM=wayland export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 export EGL_PLATFORM=gbm +CURRENT_VERSION=$(hyprctl version | grep "Tag:" | awk '{print $2}' | tr -d 'v,') -exec Hyprland -c /etc/greetd/dms-hypr.conf +MINIMUM_VERSION="0.53.0" + +if [ "$(printf '%s\n%s' "$MINIMUM_VERSION" "$CURRENT_VERSION" | sort -V | head -n1)" = "$MINIMUM_VERSION" ]; then + exec start-hyprland -- -c /etc/greetd/dms-hypr.conf +else + exec Hyprland -c /etc/greetd/dms-hypr.conf +fi