aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/qar-scrotmenu.sh12
-rwxr-xr-xbin/udt-powermenu.sh14
-rw-r--r--rofi/udt/confirm.rasi12
-rw-r--r--rofi/udt/powermenu.rasi9
-rw-r--r--rofi/udt/screenshot.rasi52
5 files changed, 53 insertions, 46 deletions
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. <danix@danix.xyz>
# 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
diff --git a/rofi/udt/confirm.rasi b/rofi/udt/confirm.rasi
index 1b288ee..242c86a 100644
--- a/rofi/udt/confirm.rasi
+++ b/rofi/udt/confirm.rasi
@@ -3,16 +3,14 @@
* Copyright (C) 2026 Danilo M. <danix@danix.xyz>
* Licensed under the GNU General Public License v2 only.
*
- * Used by the power menu's confirmation step. The screenshot menu's layout,
- * two half-monitor buttons on the scrim, with the question above them. The
- * glyph size comes from the script with -theme-str, as it does there.
+ * Used by the power menu's confirmation step. The screenshot menu's card,
+ * with the question above the two buttons.
*/
@import "screenshot.rasi"
-mainbox {
- children: [ dummy, message, listview, dummy ];
- spacing: 48px;
+card {
+ children: [ message, listview ];
}
/* The question, "Simu Sicuri?", passed by the script with -mesg. */
@@ -23,7 +21,7 @@ message {
}
textbox {
- font: "Noto Sans Bold 28";
+ font: "Noto Sans Bold 18";
text-color: @text;
horizontal-align: 0.5;
}
diff --git a/rofi/udt/powermenu.rasi b/rofi/udt/powermenu.rasi
index 92c5b07..93a833e 100644
--- a/rofi/udt/powermenu.rasi
+++ b/rofi/udt/powermenu.rasi
@@ -66,11 +66,13 @@ inputbar {
expand: false;
background-color: transparent;
padding: 0;
- children: [ prompt ];
+ children: [ dummy, prompt, dummy ];
}
+/* prompt ignores horizontal-align and draws at its own width, so the
+ * spacers either side centre it. */
prompt {
- expand: true;
+ expand: false;
font: "Noto Sans Bold 28";
text-color: @text;
horizontal-align: 0.5;
@@ -86,7 +88,10 @@ listview {
spacing: 24px;
}
+/* Text only: common.rasi's element spacing still reserves a gap for the
+ * icon, which pushed the glyph off centre. */
element {
+ children: [ element-text ];
padding: 24px 0px;
border-radius: 12px;
horizontal-align: 0.5;
diff --git a/rofi/udt/screenshot.rasi b/rofi/udt/screenshot.rasi
index 0eff248..8748628 100644
--- a/rofi/udt/screenshot.rasi
+++ b/rofi/udt/screenshot.rasi
@@ -1,12 +1,10 @@
/*
- * udt screenshot layout: two fullscreen buttons, whole screen or area.
+ * udt screenshot layout: a compact two-button card, whole screen or area.
* Copyright (C) 2026 Danilo M. <danix@danix.xyz>
* Licensed under the GNU General Public License v2 only.
*
- * Each option takes half the monitor, so the choice is one glance and one
- * click. Cells fill whatever monitor rofi opens on; the glyph size cannot be
- * a percentage in rofi, so the script passes it with -theme-str, derived from
- * the focused monitor's height. The font below is only the fallback.
+ * The window stays fullscreen for the scrim; the buttons sit on a fixed-size
+ * card centred on it, so they read the same on every monitor.
*/
@import "common.rasi"
@@ -17,13 +15,37 @@ window {
background-color: @scrim;
border: 0;
border-radius: 0;
- padding: 6%;
+ padding: 0;
}
-/* rofi sizes a row by its text, not by the space left, so spacers above and
- * below centre the row instead of leaving it pinned to the top edge. */
+/* rofi has no centring property, so spacers on both axes hold the card in
+ * the middle: mainbox centres a column horizontally, column centres the card
+ * vertically. */
mainbox {
- children: [ dummy, listview, dummy ];
+ orientation: horizontal;
+ children: [ dummy, column, dummy ];
+}
+
+/* A horizontal box sizes children by their own width, and listview reports
+ * none, so the card's width is spelled out: two 150px buttons, 16px apart,
+ * plus 24px padding and 2px border each side. */
+column {
+ expand: false;
+ width: 368px;
+ orientation: vertical;
+ children: [ dummy, card, dummy ];
+}
+
+card {
+ expand: false;
+ orientation: vertical;
+ children: [ listview ];
+ spacing: 20px;
+ padding: 24px;
+ background-color: @base;
+ border: 2px;
+ border-color: @accent;
+ border-radius: 18px;
}
dummy {
@@ -37,17 +59,21 @@ listview {
fixed-height: true;
fixed-columns: true;
flow: horizontal;
- spacing: 4%;
+ spacing: 16px;
}
+/* Text only: common.rasi's element spacing still reserves a gap for the
+ * icon, which pushed the glyph off centre. */
element {
- padding: 80px 0px;
- border-radius: 24px;
+ children: [ element-text ];
+ width: 150px;
+ padding: 28px 0px;
+ border-radius: 12px;
background-color: @surface0;
}
element-text {
- font: "Inconsolata Nerd Font Mono 160";
+ font: "Inconsolata Nerd Font Mono 72";
horizontal-align: 0.5;
vertical-align: 0.5;
text-color: inherit;