Best-practice way to extend Omarchy menu (SUPER+ALT+SPACE) with custom submenu while staying update-safe? #3889
Paulie420
started this conversation in
Suggestions
Replies: 1 comment 1 reply
-
|
Well - since this hasn't gotten any traction, I'll post some updates... my effort does continue to work after Omarchy/Omarchy Menu updates, so thats a good thing. If anyone's interested, I created two Youtube videos covering my customizations - one overview and one IN-DEPTH. Theres also a blog post and .ZIP file with ALL my custom scripts and modifications: Omarchy Linux Customizations: Omarchy Linux Customizations IN-DEPTH: Blog Post: Cheers, Omarchy r0ckstars!! pAULIE42o |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Omarchy devs — I’m loving Omarchy. I’m doing some power-user customizations and wanted to ask if my approach for extending the Omarchy menu is considered “best practice”, or if there’s a cleaner/official way you recommend.
Goal
Keep the default Omarchy hotkey/menu behavior:
SUPER+ALT+SPACE -> exec omarchy-menu
Add a new submenu entry (“Custom”) to the Omarchy menu that runs my own scripts:
NAS: smart mount / unmount
VPN: PIA connect/disconnect, PiVPN connect/disconnect
Cheatsheets: show my generated Hypr keybinds (TXT/PDF)
Status: show VPN + NAS status in a terminal
Constraints
I don’t want to directly modify upstream Omarchy files under ~/.local/share/omarchy because updates would overwrite them.
I don’t want to duplicate/override Hypr binds in a brittle way (load order / double triggers).
I want to keep receiving upstream improvements to the Omarchy menu over time.
What I implemented
A runtime patcher that reads the upstream menu and injects a submenu, then executes the patched copy:
Upstream:
~/.local/share/omarchy/bin/omarchy-menu
My patcher:
~/.config/omarchy/bin/omarchy-menu-nas.sh
It does:
read upstream menu script
apply a small patch (Python regex/string injection) to:
insert “Custom” option into the main menu list
add routing to a show_custom_menu() handler
inject a show_custom_menu() function definition with my entries
write patched output to a temp file in /tmp
exec the patched menu
if patch fails due to upstream changes, it falls back to stock menu and notifies
“Shadow” the omarchy-menu command without touching Hypr binds
I created:
~/.local/bin/omarchy-menu
with:
#!/usr/bin/env bash
exec "$HOME/.config/omarchy/bin/omarchy-menu-nas.sh" "$@"
So Hypr and Waybar still run “omarchy-menu”, but PATH resolves to my wrapper first.
Ensure PATH order is correct for the compositor session (UWSM)
In:
~/.config/uwsm/env
I set:
export OMARCHY_PATH=$HOME/.local/share/omarchy
export PATH=$HOME/.local/bin:$OMARCHY_PATH/bin:$PATH
After a Hypr/UWSM relaunch, SUPER+ALT+SPACE runs my wrapper which patches and runs the upstream menu + my injected submenu.
My “Custom” submenu actions (examples)
NAS:
~/.config/omarchy/bin/nas-mount-smart.sh
~/.config/omarchy/bin/nas-unmount-all.sh
VPN:
/opt/piavpn/bin/piactl connect|disconnect
~/.local/bin/pivpn-connect.sh
~/.local/bin/pivpn-disconnect.sh
Cheatsheets:
~/.config/omarchy/bin/show-cheatsheet.sh --all
~/.config/omarchy/bin/show-cheatsheet-pdf.sh --all
Status:
~/.config/omarchy/bin/vpn-nas-status.sh
Questions
Is shadowing “omarchy-menu” via ~/.local/bin + PATH ordering in ~/.config/uwsm/env an acceptable/expected way to customize behavior in Omarchy?
Is there an official extension mechanism or hook for adding custom menu entries (like a custom menu include file, plugin dir, or environment var) that I should use instead?
If the upstream menu changes and my patch fails, I currently fall back to stock menu. Is there a preferred strategy you’d recommend to make this more robust?
Would you be open to a feature that makes this easier (e.g., reading custom entries from ~/.config/omarchy/menu.d/ or ~/.config/omarchy/menu.json)?
If it helps, I can paste the relevant parts of my patcher script too (sanitized). I’d mainly like to confirm whether this approach is sane and update-safe, or if I’m doing something that will cause trouble later.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions