From 890e3fc8c507d292f24a1b2d56dcb82928320aca Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 9 May 2026 19:55:15 +0200 Subject: [PATCH] Set the initial GDK_SCALE to match the monitor scale --- bin/omarchy-first-run | 1 + bin/omarchy-hyprland-monitor-scale | 5 +++++ install/first-run/gdk-scale.sh | 3 +++ 3 files changed, 9 insertions(+) create mode 100755 bin/omarchy-hyprland-monitor-scale create mode 100644 install/first-run/gdk-scale.sh diff --git a/bin/omarchy-first-run b/bin/omarchy-first-run index 023d1a65..97b41f80 100755 --- a/bin/omarchy-first-run +++ b/bin/omarchy-first-run @@ -16,6 +16,7 @@ if [[ -f $FIRST_RUN_MODE ]]; then bash "$OMARCHY_PATH/install/first-run/firewall.sh" bash "$OMARCHY_PATH/install/first-run/dns-resolver.sh" bash "$OMARCHY_PATH/install/first-run/gnome-theme.sh" + bash "$OMARCHY_PATH/install/first-run/gdk-scale.sh" bash "$OMARCHY_PATH/install/first-run/swayosd.sh" bash "$OMARCHY_PATH/install/first-run/gtk-primary-paste.sh" bash "$OMARCHY_PATH/install/first-run/elephant.sh" diff --git a/bin/omarchy-hyprland-monitor-scale b/bin/omarchy-hyprland-monitor-scale new file mode 100755 index 00000000..1d9d5aae --- /dev/null +++ b/bin/omarchy-hyprland-monitor-scale @@ -0,0 +1,5 @@ +#!/bin/bash + +# omarchy:summary=Print the monitor scale of the internal monitor or first other monitor + +hyprctl monitors -j | jq -r '([.[] | select(.name | contains("eDP"))][0] // .[0]).scale // empty | tonumber | if . == floor then floor else . end' diff --git a/install/first-run/gdk-scale.sh b/install/first-run/gdk-scale.sh new file mode 100644 index 00000000..6cc23577 --- /dev/null +++ b/install/first-run/gdk-scale.sh @@ -0,0 +1,3 @@ +# Set the default GDK_SCALE from what the monitor is currently reporting + +sed -i -E "s|^([[:space:]]*env[[:space:]]*=[[:space:]]*GDK_SCALE,).*|\\1$(omarchy-hyprland-monitor-scale)|" ~/.config/hypr/monitors.conf