From 94b97972119cb053cbe07ccfd0cd308d9fe3a2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Mon, 24 Aug 2026 19:49:57 -0400 Subject: [PATCH] Display scale: session detection via Hyprland env, executable recovery hint Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01QKxGW1raAWaqeU8WdHsMsp --- bin/omarchy-cn-display-scale | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/omarchy-cn-display-scale b/bin/omarchy-cn-display-scale index 97cb3e5b..e48874a7 100755 --- a/bin/omarchy-cn-display-scale +++ b/bin/omarchy-cn-display-scale @@ -38,9 +38,9 @@ fi echo "Monitor scale: $preset, GDK scale: $gdk" -if ! command -v hyprctl > /dev/null 2>&1; then +if [[ -z ${HYPRLAND_INSTANCE_SIGNATURE:-} ]]; then rm -f "$backup" - echo "Hyprland 未运行,重登录后生效" + echo "当前不在 Hyprland 会话内,重登录后生效" elif ! hyprctl reload > /dev/null 2>&1; then mv "$backup" "$monitors" echo "hyprctl reload 失败,已恢复原配置" >&2 @@ -56,6 +56,6 @@ elif [[ -t 0 ]]; then echo "已恢复原缩放" fi else - omarchy-notification-send "OmarchyCN" "缩放已改为 $preset;如异常运行 omarchycn display scale 恢复" 2> /dev/null || true - echo "无终端交互:已应用,备份保留在 $backup,可用 mv 恢复" + omarchy-notification-send "OmarchyCN" "缩放已改为 $preset;如异常执行: mv $backup $monitors && hyprctl reload" 2> /dev/null || true + echo "无终端交互:已应用;恢复命令: mv $backup $monitors && hyprctl reload" fi