diff options
| author | Don Williams <don.e.williams@gmail.com> | 2026-08-15 09:12:14 -0400 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-08-29 21:41:34 -0700 |
| commit | 2b45c8380e9c2561ea293ce26790aaa437f6c8dc (patch) | |
| tree | ed3cb26638002e4a2b764110156305c347a161bc | |
| parent | b65377decf99a4d53583ceb0f277f17af1671267 (diff) | |
Initial copy was setting hyprlang not LUA
Fixed hyprland version check that caused issue
Signed-off-by: Don Williams <don.e.williams@gmail.com>
On branch development
Your branch is up to date with 'origin/development'.
Changes to be committed:
modified: copy.sh
| -rwxr-xr-x | copy.sh | 36 |
1 files changed, 25 insertions, 11 deletions
@@ -255,26 +255,36 @@ version_gte() { } # Parse installed Hyprland version (e.g. 0.55.4) from hyprctl/Hyprland. +# hyprctl version requires a running daemon; fall back to the Hyprland binary +# (which always reports its own version) when no version can be parsed. +_parse_hyprland_ver_from_output() { + local output="$1" + local v + v="$(printf '%s\n' "$output" | sed -n 's/^Tag: v\([0-9][0-9.]*\).*/\1/p' | head -n1 || true)" + if [ -z "$v" ] && [ -n "$output" ]; then + v="$(printf '%s\n' "$output" | sed -n 's/.*[Hh]yprland[[:space:]]\+v\?\([0-9][0-9.]*\).*/\1/p' | head -n1 || true)" + fi + printf '%s' "$v" +} get_hyprland_version() { local ver="" local full_output="" + # Try hyprctl first (works when daemon is running; some builds also work standalone) if command -v hyprctl >/dev/null 2>&1; then full_output="$(hyprctl version 2>/dev/null || true)" + ver="$(_parse_hyprland_ver_from_output "$full_output")" fi - if [ -z "$full_output" ] && command -v Hyprland >/dev/null 2>&1; then + + # Fall back to Hyprland binary — always works even when daemon is not running + if [ -z "$ver" ] && command -v Hyprland >/dev/null 2>&1; then full_output="$(Hyprland --version 2>/dev/null || true)" + ver="$(_parse_hyprland_ver_from_output "$full_output")" fi - if [ -z "$full_output" ] && command -v hyprland >/dev/null 2>&1; then - full_output="$(hyprland --version 2>/dev/null || true)" - fi - - # Prefer Tag: vX.Y.Z when present in full output - ver="$(printf '%s\n' "$full_output" | sed -n 's/^Tag: v\([0-9][0-9.]*\).*/\1/p' | head -n1 || true)" - # Fallback to matching 'Hyprland v0.X.Y' or 'Hyprland 0.X.Y' anywhere in full output - if [ -z "$ver" ] && [ -n "$full_output" ]; then - ver="$(printf '%s\n' "$full_output" | sed -n 's/.*[Hh]yprland[[:space:]]\+v\?\([0-9][0-9.]*\).*/\1/p' | head -n1 || true)" + if [ -z "$ver" ] && command -v hyprland >/dev/null 2>&1; then + full_output="$(hyprland --version 2>/dev/null || true)" + ver="$(_parse_hyprland_ver_from_output "$full_output")" fi printf '%s' "$ver" @@ -693,12 +703,16 @@ preserve_custom_sddm_configs "$LOG" ensure_lua_keybinds "$LOG" # Fresh copy defaults to Lua config when Hyprland is 0.55+. # Older Hyprland keeps Hyprlang (.conf) entrypoint. +# When version detection fails on a fresh install (daemon not yet running), +# default to Lua — 0.55+ is the minimum supported version. if [ "$RUN_MODE" = "install" ]; then - if hyprland_supports_lua; then + _hl_install_ver="$(get_hyprland_version)" + if [ -z "$_hl_install_ver" ] || version_gte "$_hl_install_ver" "$MIN_LUA_HYPRLAND_VERSION"; then enable_fresh_install_lua_config "$LOG" else warn_hyprland_too_low_for_lua "$LOG" fi + unset _hl_install_ver fi printf "\\n%.0s" {1..1} # waybar-weather config handling: |
