aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib_detect.sh
diff options
context:
space:
mode:
authorDon Williams <don.e.williams@gmail.com>2026-07-22 14:20:00 -0400
committerPinapelz <yukais@pinapelz.com>2026-08-29 21:40:35 -0700
commit5ad8ad3b4c94d50c5020beb7552282d3376ee2d0 (patch)
tree0e110faa454397bc8f851b22415afb0a716b41a6 /scripts/lib_detect.sh
parent3c7a84396dc18c315d328c40c392aa27387afd46 (diff)
Fixed hyprland-gui module not found
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: config/hypr/lua/user_overrides.lua modified: scripts/lib_copy.sh modified: scripts/lib_detect.sh
Diffstat (limited to 'scripts/lib_detect.sh')
-rw-r--r--scripts/lib_detect.sh55
1 files changed, 45 insertions, 10 deletions
diff --git a/scripts/lib_detect.sh b/scripts/lib_detect.sh
index 5bb42c3f..26449962 100644
--- a/scripts/lib_detect.sh
+++ b/scripts/lib_detect.sh
@@ -69,11 +69,47 @@ detect_nixos_adjust() {
# Qt Quick Controls style safety: enable Hyprland style only when module exists.
adjust_qt_quick_controls_style() {
local log="$1"
- local env_conf="config/hypr/configs/ENVariables.conf"
- local env_lua="config/hypr/lua/env.lua"
+ local source_hypr_dir="config/hypr"
+ local target_hypr_dir="${XDG_CONFIG_HOME:-$HOME/.config}/hypr"
local style="Basic"
local qt_style_override="Fusion"
local has_kvantum_qml=0
+ local set_env_conf_vars
+ local set_env_lua_vars
+
+ set_env_conf_vars() {
+ local file="$1"
+ [ -f "$file" ] || return 0
+
+ if grep -q '^env = QT_QUICK_CONTROLS_STYLE,' "$file"; then
+ sed -i -E "s|^env = QT_QUICK_CONTROLS_STYLE,.*$|env = QT_QUICK_CONTROLS_STYLE,${style}|" "$file"
+ else
+ printf '\nenv = QT_QUICK_CONTROLS_STYLE,%s\n' "$style" >>"$file"
+ fi
+
+ if grep -q '^env = QT_STYLE_OVERRIDE,' "$file"; then
+ sed -i -E "s|^env = QT_STYLE_OVERRIDE,.*$|env = QT_STYLE_OVERRIDE,${qt_style_override}|" "$file"
+ else
+ printf 'env = QT_STYLE_OVERRIDE,%s\n' "$qt_style_override" >>"$file"
+ fi
+ }
+
+ set_env_lua_vars() {
+ local file="$1"
+ [ -f "$file" ] || return 0
+
+ if grep -q '^hl\.env("QT_QUICK_CONTROLS_STYLE",' "$file"; then
+ sed -i -E "s|^hl\\.env\\(\"QT_QUICK_CONTROLS_STYLE\", \".*\"\\)$|hl.env(\"QT_QUICK_CONTROLS_STYLE\", \"${style}\")|" "$file"
+ else
+ printf '\nhl.env("QT_QUICK_CONTROLS_STYLE", "%s")\n' "$style" >>"$file"
+ fi
+
+ if grep -q '^hl\.env("QT_STYLE_OVERRIDE",' "$file"; then
+ sed -i -E "s|^hl\\.env\\(\"QT_STYLE_OVERRIDE\", \".*\"\\)$|hl.env(\"QT_STYLE_OVERRIDE\", \"${qt_style_override}\")|" "$file"
+ else
+ printf 'hl.env("QT_STYLE_OVERRIDE", "%s")\n' "$qt_style_override" >>"$file"
+ fi
+ }
if find /usr/lib /usr/lib64 /usr/share -type d -path '*/qml/*/org/hyprland/style' -print -quit 2>/dev/null | grep -q .; then
style="org.hyprland.style"
@@ -86,14 +122,13 @@ adjust_qt_quick_controls_style() {
qt_style_override="kvantum"
fi
- if [ -f "$env_conf" ]; then
- sed -i -E "s|^env = QT_QUICK_CONTROLS_STYLE,.*$|env = QT_QUICK_CONTROLS_STYLE,${style}|" "$env_conf"
- sed -i -E "s|^env = QT_STYLE_OVERRIDE,.*$|env = QT_STYLE_OVERRIDE,${qt_style_override}|" "$env_conf"
- fi
- if [ -f "$env_lua" ]; then
- sed -i -E "s|^hl\\.env\\(\"QT_QUICK_CONTROLS_STYLE\", \".*\"\\)$|hl.env(\"QT_QUICK_CONTROLS_STYLE\", \"${style}\")|" "$env_lua"
- sed -i -E "s|^hl\\.env\\(\"QT_STYLE_OVERRIDE\", \".*\"\\)$|hl.env(\"QT_STYLE_OVERRIDE\", \"${qt_style_override}\")|" "$env_lua"
- fi
+ set_env_conf_vars "$source_hypr_dir/configs/ENVariables.conf"
+ set_env_lua_vars "$source_hypr_dir/lua/env.lua"
+ set_env_lua_vars "$source_hypr_dir/configs/system_env.lua"
+
+ set_env_conf_vars "$target_hypr_dir/configs/ENVariables.conf"
+ set_env_lua_vars "$target_hypr_dir/lua/env.lua"
+ set_env_lua_vars "$target_hypr_dir/configs/system_env.lua"
if [ "$style" = "org.hyprland.style" ]; then
echo "${INFO:-[INFO]} hyprland Qt style module detected. Using QT_QUICK_CONTROLS_STYLE=$style" 2>&1 | tee -a "$log" || true
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage