mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-13 09:12:08 -04:00
feat(dms-greeter): add Niri override kdl includes (#1616)
This will optionally include one or two files into the Niri conf for dms-greeter: - `/usr/share/greetd/niri_overrides.kdl` (for building into a system image) - `/etc/greetd/niri_overrides.kdl` (for local overrides) This enables a distro or a system administrator to easily add their own customizations to the dms-greeter Niri configuration. Note: Niri next includes https://github.com/YaLTeR/niri/pull/3022 which can make this a whole lot simpler: we're testing for the existence of files and optionally adding `include` lines within the dms-greeter shell script, but in the future it will be possible to simply use `include optional=true` which we can just append unconditionally. Lastly, I deduplicated the line that spawns the actual greeter by appending that unconditionally at the end.
This commit is contained in:
@@ -125,6 +125,7 @@ case "$COMPOSITOR" in
|
|||||||
niri)
|
niri)
|
||||||
if [[ -z "$COMPOSITOR_CONFIG" ]]; then
|
if [[ -z "$COMPOSITOR_CONFIG" ]]; then
|
||||||
TEMP_CONFIG=$(mktemp)
|
TEMP_CONFIG=$(mktemp)
|
||||||
|
# base/default config
|
||||||
cat > "$TEMP_CONFIG" << NIRI_EOF
|
cat > "$TEMP_CONFIG" << NIRI_EOF
|
||||||
hotkey-overlay {
|
hotkey-overlay {
|
||||||
skip-at-startup
|
skip-at-startup
|
||||||
@@ -134,8 +135,6 @@ environment {
|
|||||||
DMS_RUN_GREETER "1"
|
DMS_RUN_GREETER "1"
|
||||||
}
|
}
|
||||||
|
|
||||||
spawn-at-startup "sh" "-c" "$QS_CMD; niri msg action quit --skip-confirmation"
|
|
||||||
|
|
||||||
debug {
|
debug {
|
||||||
keep-max-bpc-unchanged
|
keep-max-bpc-unchanged
|
||||||
}
|
}
|
||||||
@@ -154,12 +153,27 @@ NIRI_EOF
|
|||||||
else
|
else
|
||||||
TEMP_CONFIG=$(mktemp)
|
TEMP_CONFIG=$(mktemp)
|
||||||
cat "$COMPOSITOR_CONFIG" > "$TEMP_CONFIG"
|
cat "$COMPOSITOR_CONFIG" > "$TEMP_CONFIG"
|
||||||
|
fi
|
||||||
|
# Append includes if override_files exist
|
||||||
|
OVERRIDE_FILES=(
|
||||||
|
/usr/share/greetd/niri_overrides.kdl # for building into a system image
|
||||||
|
/etc/greetd/niri_overrides.kdl # for local overrides
|
||||||
|
)
|
||||||
|
for override_file in "${OVERRIDE_FILES[@]}"; do
|
||||||
|
if [[ -e "$override_file" ]]; then
|
||||||
|
# TODO: maybe move to optional=true when Niri Next drops, so we can avoid these checks ;-)
|
||||||
|
cat >> "$TEMP_CONFIG" << NIRI_EOF
|
||||||
|
|
||||||
|
include "$override_file"
|
||||||
|
NIRI_EOF
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# Append spawn command
|
||||||
cat >> "$TEMP_CONFIG" << NIRI_EOF
|
cat >> "$TEMP_CONFIG" << NIRI_EOF
|
||||||
|
|
||||||
spawn-at-startup "sh" "-c" "$QS_CMD; niri msg action quit --skip-confirmation"
|
spawn-at-startup "sh" "-c" "$QS_CMD; niri msg action quit --skip-confirmation"
|
||||||
NIRI_EOF
|
NIRI_EOF
|
||||||
COMPOSITOR_CONFIG="$TEMP_CONFIG"
|
COMPOSITOR_CONFIG="$TEMP_CONFIG"
|
||||||
fi
|
|
||||||
exec niri -c "$COMPOSITOR_CONFIG"
|
exec niri -c "$COMPOSITOR_CONFIG"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user