mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-13 14:36:32 -04:00
@@ -75,6 +75,19 @@ normalize_bool_flag() {
|
|||||||
esac
|
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() {
|
exec_compositor() {
|
||||||
local log_tag="$1"
|
local log_tag="$1"
|
||||||
shift
|
shift
|
||||||
@@ -306,7 +319,17 @@ NIRI_EOF
|
|||||||
echo "Error: neither 'start-hyprland' nor 'Hyprland' was found in PATH" >&2
|
echo "Error: neither 'start-hyprland' nor 'Hyprland' was found in PATH" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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)
|
TEMP_CONFIG=$(mktemp)
|
||||||
cat > "$TEMP_CONFIG" << HYPRLAND_EOF
|
cat > "$TEMP_CONFIG" << HYPRLAND_EOF
|
||||||
env = DMS_RUN_GREETER,1
|
env = DMS_RUN_GREETER,1
|
||||||
|
|||||||
Reference in New Issue
Block a user