From 02c3277356271bc9f2969cd56ee654e95ef9ce9e Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sun, 18 Oct 2026 11:14:08 +0200 Subject: fix(rofi): compact confirm and screenshot cards, centre glyphs The confirm and screenshot menus split the monitor into two half-screen buttons with a glyph sized from the monitor height. They are now a fixed 368px card centred on the scrim, two 150px buttons at 72pt, so the scripts no longer compute a glyph size. Glyphs in all three menus sat right of centre: common.rasi's element spacing still reserved a gap for the hidden icon. Elements now hold element-text only. The power menu's greeting ignored horizontal-align, so spacers either side centre it. Co-Authored-By: Claude Opus 5.5 --- bin/qar-scrotmenu.sh | 12 +----------- bin/udt-powermenu.sh | 14 +------------- 2 files changed, 2 insertions(+), 24 deletions(-) (limited to 'bin') diff --git a/bin/qar-scrotmenu.sh b/bin/qar-scrotmenu.sh index b60cbc8..90aae41 100755 --- a/bin/qar-scrotmenu.sh +++ b/bin/qar-scrotmenu.sh @@ -3,17 +3,7 @@ # Copyright (C) 2026 Danilo M. # Licensed under the GNU General Public License v2 only. -# Glyph size follows the monitor rofi opens on (the focused one), in points, -# since rofi cannot size a font by percentage. Each cell gets half the width, -# so a quarter of the smaller of half-width and height fits both a wide and a -# rotated portrait monitor. Odd transforms are 90/270 degree rotations, which -# swap the reported width and height. -size=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .scale as $s - | (if .transform % 2 == 1 then [.height, .width] else [.width, .height] end) - | [.[0] / 2, .[1]] | min / $s / 4 | floor' 2>/dev/null) -size=${size:-135} -rofi_command=(rofi -theme ~/.config/rofi/udt/screenshot.rasi - -theme-str "element-text { font: \"Inconsolata Nerd Font Mono $size\"; }") +rofi_command=(rofi -theme ~/.config/rofi/udt/screenshot.rasi) ### Options ### screen="" diff --git a/bin/udt-powermenu.sh b/bin/udt-powermenu.sh index a8524b4..6d8fb84 100755 --- a/bin/udt-powermenu.sh +++ b/bin/udt-powermenu.sh @@ -35,25 +35,13 @@ rofi_cmd() { -theme ${dir}/${theme}.rasi } -# Confirmation glyph size follows the focused monitor, as in -# qar-scrotmenu.sh: a quarter of the smaller of half-width and height, with -# 90/270 degree rotations (odd transforms) swapping width and height. -confirm_size() { - hyprctl monitors -j | jq -r '.[] | select(.focused) | .scale as $s - | (if .transform % 2 == 1 then [.height, .width] else [.width, .height] end) - | [.[0] / 2, .[1]] | min / $s / 4 | floor' 2>/dev/null -} - # Confirmation CMD confirm_cmd() { - local size - size=$(confirm_size) rofi -dmenu \ -p 'Confirmation' \ -selected-row 1 \ -mesg 'Simu Sicuri?' \ - -theme "$HOME/.config/rofi/udt/confirm.rasi" \ - -theme-str "element-text { font: \"Inconsolata Nerd Font Mono ${size:-135}\"; }" + -theme "$HOME/.config/rofi/udt/confirm.rasi" } # Ask for confirmation -- cgit v1.2.3