feat(hyprland): implement declarative monitor scaling and add scale picker to welcome wizard
Some checks failed
Check / eval-and-lint (push) Failing after 6m36s

This commit is contained in:
Bernardo Magri
2026-05-31 19:21:52 +01:00
parent 8911ffa4e8
commit a2649728d3
7 changed files with 30 additions and 31 deletions

View File

@@ -1,23 +0,0 @@
# See https://wiki.hyprland.org/Configuring/Monitors/
# List current monitors and resolutions possible: hyprctl monitors
# Format: monitor = [port], resolution, position, scale
# Optimized for retina-class 2x displays, like 13" 2.8K, 27" 5K, 32" 6K.
#env = GDK_SCALE,2
#monitor=,preferred,auto,auto
# Good compromise for 27" or 32" 4K monitors (but fractional!)
# env = GDK_SCALE,1.75
# monitor=,preferred,auto,1.6
# Straight 1x setup for low-resolution displays like 1080p or 1440p
# Or for ultrawide monitors like 34" 3440x1440 or 49" 5120x1440
env = GDK_SCALE,1
monitor=,highres,auto,1
# Portrait/rotated secondary monitor (transform: 1 = 90°, 3 = 270°)
# monitor = DP-2, preferred, auto, 1, transform, 1
# Example for Framework 13 w/ 6K XDR Apple display
# monitor = DP-5, 6016x3384@60, auto, 2
# monitor = eDP-1, 2880x1920@120, auto, 2

View File

@@ -53,7 +53,11 @@ in
# live under ~/.config/nomarchy/default/hypr/ and are deployed by the
# core/home bulk-nomarchy dir, so duplicating them here was dead surface.
xdg.configFile."hypr/nomarchy.conf".source = ./config/nomarchy.conf;
xdg.configFile."hypr/monitors.conf".source = lib.mkDefault ./config/monitors.conf;
xdg.configFile."hypr/monitors.conf".text = lib.mkDefault ''
# Auto-generated by Nomarchy features/desktop/hyprland/default.nix
# monitor = [port], resolution, position, scale
monitor = , highres, auto, ${config.nomarchy.hyprland.scale}
'';
xdg.configFile."hypr/input.conf".source = lib.mkDefault ./config/input.conf;
xdg.configFile."hypr/bindings.conf".source = lib.mkDefault ./config/bindings.conf;

View File

@@ -56,6 +56,18 @@ if [[ -n "$POSITION" ]]; then
nomarchy-state-write panelPosition "$POSITION"
fi
# 4. Select monitor scaling
echo "Step 4: Choose your monitor scaling"
echo "Recommended: 'auto' for most screens, '2' for 4K/HiDPI."
SCALE=$(gum choose "auto" "1" "1.25" "1.5" "2")
if [[ -n "$SCALE" ]]; then
# Write to nested hyprland.scale key
STATE_DIR="$HOME/.config/nomarchy"
mkdir -p "$STATE_DIR"
TMP_FILE=\$(mktemp)
jq ".hyprland.scale = \"$SCALE\"" "\$STATE_FILE" > "\$TMP_FILE" && mv "\$TMP_FILE" "\$STATE_FILE"
fi
# Skip system-modifying steps in the Live ISO environment
if [[ "$USER" == "nixos" ]]; then
echo ""