Files
ricing/sddm/aether-rice/Xsetup
nico 3ae03bed4f Add a custom palette-driven SDDM login theme
New sddm/aether-rice/: matches the rest of the rice (Bar/mako palette,
JetBrainsMono, popup-glass login card), synced live into
/usr/share/sddm/themes/aether-rice by render.py's sync_sddm_theme() -
no sudo after the one-time setup documented in the README, since the
greeter can't read anything under ~/.config ($HOME is 700).

Custom Rectangle+MouseArea buttons instead of SddmComponents' Button,
which can get its background stuck on the wrong color (drives it
through named states, but also assigns it as a plain property - once
something sets that outside the state machine, idle has nothing
correct to revert to). Session/layout row is last in the card, not
above the buttons, because ComboBox/LayoutBox open their dropdown as a
plain child Rectangle that paints under whatever comes later in the
same Column - it was invisible behind the buttons above it.

Xsetup runs `xrandr --output <biggest> --primary` before the greeter
starts, so the login card lands on the right monitor - `<biggest>` is
picked dynamically by resolution, not hardcoded, since Xorg (esp. with
nvidia) often names outputs differently than Wayland/DRM does.

Known, unfixable-from-here limitation documented in the README: the
keyboard layout shows/applies as the wrong one until the first
keypress, on every SDDM theme including its own bundled ones - a
confirmed open upstream bug (sddm/sddm#1845), not something a theme's
QML can work around.

Also fixes wallpaper.py never syncing the login screen's background:
it doesn't go through render.py at all normally, so it now calls
render.sync_sddm_theme() itself.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
2026-09-30 00:39:41 +02:00

37 lines
1.5 KiB
Bash
Executable File

#!/bin/sh
# Runs as root before the greeter appears (SDDM's [X11] DisplayCommand=).
# The biggest monitor isn't otherwise marked primary in a fresh X session - SDDM's own
# X server then just defaults to whichever output it enumerates first, which is why
# Main.qml's `primaryScreen` would land on the wrong screen without this.
#
# Not a hardcoded output name: Xorg (especially with the nvidia driver, in use here)
# often names outputs differently than Wayland/DRM does (e.g. "DP-0" vs Hyprland's
# "DP-1") - a name copied from `hyprctl monitors` can silently match nothing here.
# Picking by resolution instead works regardless of what this X server calls it.
BIGGEST=$(xrandr --query | awk '
/^[A-Za-z0-9_-]+ connected/ {
name = $1
for (i = 1; i <= NF; i++) {
if ($i ~ /^[0-9]+x[0-9]+\+/) {
split($i, wh, "x")
split(wh[2], hxy, "+")
area = wh[1] * hxy[1]
if (area > maxarea) { maxarea = area; biggest = name }
}
}
}
END { print biggest }
')
{
echo "$(date -Iseconds) xrandr --query:"
xrandr --query
echo "$(date -Iseconds) picked biggest output: '$BIGGEST'"
if [ -n "$BIGGEST" ]; then
xrandr --output "$BIGGEST" --primary
echo "$(date -Iseconds) xrandr --output $BIGGEST --primary exit code: $?"
fi
} >/tmp/aether-rice-xsetup.log 2>&1
# Preserve whatever the stock script does, in case a future sddm update adds to it.
exec /usr/share/sddm/scripts/Xsetup "$@"