fix(rofi): Display menu Back returns to System on single-monitor
All checks were successful
Check / eval (push) Successful in 3m0s
All checks were successful
Check / eval (push) Successful in 3m0s
The mode picker's Back did `exec "$0" display`. On a single-monitor machine with no display profiles the output chooser is skipped, so re-running `display` dropped straight back into the same mode picker — an apparent no-op. Track modeBack (display when the chooser was shown, else system) and dispatch Back to it, so single-monitor Back leaves Display. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -50,12 +50,6 @@ still doesn't open the keybindings cheatsheet. Re-diagnose: confirm the
|
||||
Hyprland bind's modmask/keysym against the *actual* layout, whether rofi
|
||||
2.0.0 changed anything, and that the cheatsheet path still resolves.
|
||||
|
||||
### 40. Display rofi menu "Back" doesn't return `[bug]`
|
||||
(Raised by Bernardo, 2026-07-07 — item 10.) In System › Display, the
|
||||
Back row fails to return to the previous menu (other submenus' Back work
|
||||
— cf. the item 24 audit). Trace the Display handler's Back case /
|
||||
dispatch target.
|
||||
|
||||
### 39. Icons in the power-profile rofi menu
|
||||
(Raised by Bernardo, 2026-07-07 — item 9.) The power-profile picker
|
||||
(rofi.nix `power-profile`) lists profiles as bare text; add per-profile
|
||||
|
||||
@@ -17,6 +17,21 @@ Template:
|
||||
|
||||
---
|
||||
|
||||
## 2026-07-07 — Display menu "Back" doesn't return (iteration #57, item 40)
|
||||
- **Task:** BACKLOG item 40 — in System › Display the Back row didn't
|
||||
return on a single-monitor machine.
|
||||
- **Root cause:** the mode picker's Back did `exec "$0" display`. On a
|
||||
single-monitor laptop with no display profiles, the output chooser is
|
||||
skipped, so re-running `display` drops straight back into the *same*
|
||||
mode picker — an apparent no-op. (Multi-monitor works: `display`
|
||||
re-shows the chooser, a genuine previous level.)
|
||||
- **Fix:** `modules/home/rofi.nix` display handler now tracks `modeBack` —
|
||||
`display` when the chooser was shown, else `system`. Mode-picker Back
|
||||
does `exec "$0" "$modeBack"`, so single-monitor Back leaves Display for
|
||||
System.
|
||||
- **Verified:** V0 `nix flake check --no-build` green. Logic is
|
||||
deterministic; the single- vs multi-monitor branch is the whole fix.
|
||||
|
||||
## 2026-07-07 — Menu "Back" double arrows (iteration #56, item 34)
|
||||
- **Task:** BACKLOG item 34 — every submenu's `↩ Back` row drew two
|
||||
arrows: the `↩` glyph in the label AND a themed `go-previous` icon.
|
||||
|
||||
@@ -335,6 +335,11 @@ ${themeRows}
|
||||
|
||||
# Choose the output (skip the chooser when only one is connected and
|
||||
# there are no profiles — the Profiles row needs the chooser to live in).
|
||||
# Where the mode picker's Back returns to: the output chooser when it
|
||||
# was shown (a real previous level), else straight to System — on a
|
||||
# single-monitor laptop the chooser is skipped, so returning to
|
||||
# `display` would just re-open this same mode picker (item 40).
|
||||
modeBack=system
|
||||
profs=; command -v nomarchy-display-profile >/dev/null 2>&1 && profs=1
|
||||
if [ -n "$profs" ] || [ "$(printf '%s' "$mons" | jq -r '.[].name' | grep -c .)" -gt 1 ]; then
|
||||
name=$( {
|
||||
@@ -345,6 +350,7 @@ ${themeRows}
|
||||
[ "$name" = "$BACK" ] && exec "$0" system
|
||||
[ "$name" = "Profiles ›" ] && exec "$0" display-profile
|
||||
name=''${name%% ·*} # strip the " · WxH@R" hint
|
||||
modeBack=display
|
||||
else
|
||||
name=$(printf '%s' "$mons" | jq -r '.[0].name')
|
||||
fi
|
||||
@@ -361,7 +367,7 @@ ${themeRows}
|
||||
| sed 's/Hz$//' | awk -F@ '{ printf "%s@%d\n", $1, $2 + 0.5 }' | sort -rV -u
|
||||
printf '%s\n' "$BACK"
|
||||
} | rofi -dmenu -p "$name (now $cur)" ) || exit 0
|
||||
[ "$mode" = "$BACK" ] && exec "$0" display
|
||||
[ "$mode" = "$BACK" ] && exec "$0" "$modeBack"
|
||||
[ -n "$mode" ] || exit 0
|
||||
|
||||
# Apply live (keep the output's current position + scale), then persist.
|
||||
|
||||
Reference in New Issue
Block a user