feat(menu): group the rofi picker into Tools / System submenus
The root picker had grown to 16 flat entries. Collapse it to six — Apps · Theme · Tools › · System › · Power · Keybindings — with Tools (Calculator, Clipboard, Emoji, Files, Web, Capture, Ask) and System (Network, Bluetooth, DND, plus the self-gated Snapshots / Power-profile) as submenus the dispatcher routes via `nomarchy-menu tools|system`. Each submenu ends in a ← Back entry that re-opens the root. The direct SUPER+CTRL+<mnemonic> binds still reach the leaves straight (bypassing the menu), and the gated entries still hide when unavailable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -37,15 +37,16 @@ how to override it. Items marked ✓ are shipped.
|
||||
launcher, no second theming pipeline; the dispatcher owns the menu
|
||||
structure, so the renderer stays swappable (we moved fuzzel → rofi 2.0
|
||||
once mainline gained native Wayland, for its richer theming)
|
||||
- **Organize the picker into category submenus:** the root picker has grown
|
||||
into a long flat list (Apps · Theme · Clipboard · Calculator · Files ·
|
||||
Emoji · Web · Network · Bluetooth · Capture · Keybindings · Ask · DND ·
|
||||
Snapshots · Power profile · Power · …). Group it into category submenus
|
||||
(e.g. **System**, **Tools**, **Look & Feel**, **Power**) so the top level
|
||||
stays short and scannable, the dispatcher routing `nomarchy-menu <category>`
|
||||
→ its leaf modules. Keep the direct `SUPER+CTRL+<mnemonic>` binds as fast
|
||||
paths straight to the leaves (they bypass the menu), and self-gated
|
||||
entries (power-profile, snapshots) still hide when unavailable.
|
||||
- ✓ **Organize the picker into category submenus:** the root picker had grown
|
||||
into a long flat list of 16 entries. It's now six: **Apps · Theme · Tools ›
|
||||
· System › · Power · Keybindings**. `Tools` (Calculator, Clipboard, Emoji,
|
||||
Files, Web, Capture, Ask) and `System` (Network, Bluetooth, DND, and the
|
||||
self-gated Snapshots / Power-profile) are submenus the dispatcher routes via
|
||||
`nomarchy-menu tools|system`, each ending in a `← Back` entry that re-opens
|
||||
the root. The direct `SUPER+CTRL+<mnemonic>` binds still hit the leaves
|
||||
straight (bypassing the menu), and the self-gated entries still hide when
|
||||
unavailable. Remaining (optional): a **Look & Feel** category once there are
|
||||
more appearance toggles to group with Theme (night-light, wallpaper).
|
||||
- ✓ **Menu modules from rofi plugins:** the old `calc` flow committed the
|
||||
expression blind (result only in the *next* menu's `-mesg`) and `qalc -t`
|
||||
misparsed common phrasings (`15% of 200` → `rem(15, 1 B)`, the natural-
|
||||
|
||||
@@ -180,54 +180,78 @@ let
|
||||
|| { notify-send "Snapshots" "btrfs-assistant isn't installed (BTRFS snapshots off?)."; exit 0; }
|
||||
exec btrfs-assistant ;;
|
||||
|
||||
"")
|
||||
tools)
|
||||
# Tools submenu — utilities you invoke. Each leaf is also reachable
|
||||
# directly (SUPER+CTRL+<mnemonic>); this just keeps the root short.
|
||||
choice=$(printf '%s\n' \
|
||||
" Calculator" \
|
||||
" Clipboard" \
|
||||
" Emoji" \
|
||||
" Files" \
|
||||
" Web search" \
|
||||
" Capture" \
|
||||
" Ask Claude" \
|
||||
" Back" \
|
||||
| rofi -dmenu -p tools) || exit 0
|
||||
case "$choice" in
|
||||
*Calc*) exec "$0" calc ;;
|
||||
*Clipboard*) exec "$0" clipboard ;;
|
||||
*Emoji*) exec "$0" emoji ;;
|
||||
*Files*) exec "$0" files ;;
|
||||
*Web*) exec "$0" web ;;
|
||||
*Capture*) exec "$0" capture ;;
|
||||
*Ask*) exec "$0" ask ;;
|
||||
*Back*) exec "$0" ;;
|
||||
esac ;;
|
||||
|
||||
system)
|
||||
# System submenu — connectivity and machine state. Snapshots and the
|
||||
# power-profile picker self-gate (BTRFS+snapper / laptop on ppd), so
|
||||
# the submenu shrinks to match the hardware, like the Waybar modules.
|
||||
entries=(
|
||||
" Apps"
|
||||
" Theme"
|
||||
" Clipboard"
|
||||
" Calculator"
|
||||
" Files"
|
||||
" Emoji"
|
||||
" Web search"
|
||||
" Network"
|
||||
" Bluetooth"
|
||||
" Capture"
|
||||
" Keybindings"
|
||||
" Ask Claude"
|
||||
" Do Not Disturb"
|
||||
)
|
||||
# Snapshots only when btrfs-assistant is installed (BTRFS + snapper).
|
||||
command -v btrfs-assistant >/dev/null 2>&1 && entries+=(" Snapshots")
|
||||
# Power-profile picker only when this is a laptop (battery present)
|
||||
# running power-profiles-daemon — matches the Waybar indicator's
|
||||
# self-gating; desktops and the TLP backend don't show it.
|
||||
bats=(/sys/class/power_supply/BAT*)
|
||||
if [ -e "''${bats[0]}" ] && command -v powerprofilesctl >/dev/null 2>&1; then
|
||||
entries+=(" Power profile")
|
||||
fi
|
||||
entries+=(" Power")
|
||||
choice=$(printf '%s\n' "''${entries[@]}" | rofi -dmenu -p menu) || exit 0
|
||||
entries+=(" Back")
|
||||
choice=$(printf '%s\n' "''${entries[@]}" | rofi -dmenu -p system) || exit 0
|
||||
case "$choice" in
|
||||
*Apps*) exec rofi -show drun ;;
|
||||
*Theme*) exec "$0" theme ;;
|
||||
*Clipboard*) exec "$0" clipboard ;;
|
||||
*Calc*) exec "$0" calc ;;
|
||||
*Files*) exec "$0" files ;;
|
||||
*Emoji*) exec "$0" emoji ;;
|
||||
*Web*) exec "$0" web ;;
|
||||
*Network*) exec "$0" network ;;
|
||||
*Bluetooth*) exec "$0" bluetooth ;;
|
||||
*Capture*) exec "$0" capture ;;
|
||||
*Keybindings*) exec "$0" keybinds ;;
|
||||
*Ask*) exec "$0" ask ;;
|
||||
*Network*) exec "$0" network ;;
|
||||
*Bluetooth*) exec "$0" bluetooth ;;
|
||||
*"Do Not Disturb"*) exec "$0" dnd ;;
|
||||
*Snapshots*) exec "$0" snapshot ;;
|
||||
*"Power profile"*) exec "$0" power-profile ;;
|
||||
*Power*) exec "$0" power ;;
|
||||
*Snapshots*) exec "$0" snapshot ;;
|
||||
*"Power profile"*) exec "$0" power-profile ;;
|
||||
*Back*) exec "$0" ;;
|
||||
esac ;;
|
||||
|
||||
"")
|
||||
# Root picker — grouped into category submenus so the top level stays
|
||||
# short and scannable. Apps/Theme/Power/Keybindings are frequent enough
|
||||
# to keep at the top; everything else lives under Tools or System.
|
||||
choice=$(printf '%s\n' \
|
||||
" Apps" \
|
||||
" Theme" \
|
||||
" Tools" \
|
||||
" System" \
|
||||
" Power" \
|
||||
" Keybindings" \
|
||||
| rofi -dmenu -p menu) || exit 0
|
||||
case "$choice" in
|
||||
*Apps*) exec rofi -show drun ;;
|
||||
*Theme*) exec "$0" theme ;;
|
||||
*Tools*) exec "$0" tools ;;
|
||||
*System*) exec "$0" system ;;
|
||||
*Power*) exec "$0" power ;;
|
||||
*Keybindings*) exec "$0" keybinds ;;
|
||||
esac ;;
|
||||
|
||||
*)
|
||||
echo "usage: nomarchy-menu [power|power-profile|theme|clipboard|calc|files|emoji|web|network|bluetooth|capture|keybinds|ask|dnd|snapshot]" >&2
|
||||
echo "usage: nomarchy-menu [tools|system|power|power-profile|theme|clipboard|calc|files|emoji|web|network|bluetooth|capture|keybinds|ask|dnd|snapshot]" >&2
|
||||
exit 64 ;;
|
||||
esac
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user