mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-07 19:59:14 -04:00
@@ -75,6 +75,19 @@ normalize_bool_flag() {
|
||||
esac
|
||||
}
|
||||
|
||||
is_hyprland_lua_config() {
|
||||
local config_file="$1"
|
||||
case "$config_file" in
|
||||
*.lua)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
if [[ -f "$config_file" ]] && grep -qE '(^|[^[:alnum:]_])hl\.' "$config_file"; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
exec_compositor() {
|
||||
local log_tag="$1"
|
||||
shift
|
||||
@@ -306,7 +319,17 @@ NIRI_EOF
|
||||
echo "Error: neither 'start-hyprland' nor 'Hyprland' was found in PATH" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z "$COMPOSITOR_CONFIG" ]]; then
|
||||
if [[ -n "$COMPOSITOR_CONFIG" ]] && is_hyprland_lua_config "$COMPOSITOR_CONFIG"; then
|
||||
TEMP_CONFIG=$(mktemp --suffix=.lua)
|
||||
cat "$COMPOSITOR_CONFIG" > "$TEMP_CONFIG"
|
||||
cat >> "$TEMP_CONFIG" << HYPRLAND_LUA_EOF
|
||||
|
||||
hl.on("hyprland.start", function()
|
||||
hl.exec_cmd('sh -c "$QS_CMD; hyprctl dispatch exit"')
|
||||
end)
|
||||
HYPRLAND_LUA_EOF
|
||||
COMPOSITOR_CONFIG="$TEMP_CONFIG"
|
||||
elif [[ -z "$COMPOSITOR_CONFIG" ]]; then
|
||||
TEMP_CONFIG=$(mktemp)
|
||||
cat > "$TEMP_CONFIG" << HYPRLAND_EOF
|
||||
env = DMS_RUN_GREETER,1
|
||||
|
||||
Reference in New Issue
Block a user