From 7da664c801123fcba87c7bfbdab47c535c7064a3 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 11 Sep 2026 09:58:06 +0200 Subject: fix: draw the power menu avatar again Sizing the widget with an explicit width and height collapsed it, so nothing was drawn. The original type-4 theme sized it with a horizontal margin instead, letting the widget expand to the window and squeezing it back to a square, so do that. The margin is computed with calc() from 50% rather than the original's hardcoded 710px, which assumed one screen width and would sit off-center on a second monitor. The tilde path was never the problem: rofi does expand it inside a url(). Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01G6aeE37K4GHBsaM51yLTTq --- rofi/udt/powermenu.rasi | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'rofi') diff --git a/rofi/udt/powermenu.rasi b/rofi/udt/powermenu.rasi index 6660e9f..864f571 100644 --- a/rofi/udt/powermenu.rasi +++ b/rofi/udt/powermenu.rasi @@ -29,13 +29,20 @@ dummy { expand: true; } -/* The avatar. `both` fills the box, the radius makes it a circle. */ +/* The avatar. + * + * Sized by horizontal margin rather than width/height, which is how the + * original type-4 theme did it: the widget expands to the window and the + * margin squeezes it back to a square. Setting an explicit width and height + * instead collapses it and nothing is drawn. + * + * The margin is therefore tied to screen width. It is expressed in calc() from + * 50% so it stays centered on any monitor, rather than the original's hardcoded + * 710px, which assumed one specific resolution. */ userimage { - expand: false; - width: 120px; - height: 120px; - horizontal-align: 0.5; + margin: 0px calc(50% - 70px); background-image: url("~/.user-icon.jpg", both); + background-color: transparent; border: 2px; border-color: @accent; border-radius: 100%; -- cgit v1.2.3