From 41ed9191a5e0dc19eb043fcbac5748ad81100966 Mon Sep 17 00:00:00 2001 From: Jan-Arve Nygard Date: Fri, 4 Dec 2026 13:00:41 +0000 Subject: [PATCH 1/2] Menu: entries that install from the AUR show only where yay is omarchy-pkg-aur-add, omarchy-pkg-aur-install and omarchy-pkg-remove run yay, which the image doesn't ship, so Install > Browser > Brave stopped on "yay: command not found". Brave, Brave Origin, Zen, Edge (x86 too), Install > AUR, Install > Editor > Emacs and Remove > Package now show once yay is installed. Chromium and Firefox come from pacman and stay. Tested on an iPad Air 2 (j82): Install > Browser lists Chromium, Chrome and Firefox. Fixes #286 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SLbz23ZoimaemGQ2yfdfhR --- .../shell/default/omarchy/omarchy-menu.jsonc | 16 +++--- tests/test_menu_yay.py | 51 +++++++++++++++++++ 2 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 tests/test_menu_yay.py diff --git a/desktop/shell/default/omarchy/omarchy-menu.jsonc b/desktop/shell/default/omarchy/omarchy-menu.jsonc index fff89ff1..9019f73b 100644 --- a/desktop/shell/default/omarchy/omarchy-menu.jsonc +++ b/desktop/shell/default/omarchy/omarchy-menu.jsonc @@ -317,15 +317,17 @@ "install.terminal": {"icon":"","label":"Terminal"}, "install.tui": {"icon":"","label":"TUI","action":"omarchy-launch-floating-terminal-with-presentation omarchy-tui-install"}, "install.windows": {"icon":"󰍲","label":"Windows","when":"omarchy-hw-x86","disabled":"[[ -f $HOME/.local/share/applications/windows-vm.desktop ]]","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-windows-vm install'"}, - "install.aur": {"icon":"󰣇","label":"AUR","action":"xdg-terminal-exec --app-id=org.omarchy.terminal omarchy-pkg-aur-install"}, + "install.aur": {"icon":"󰣇","label":"AUR","when":"omarchy-cmd-present yay","action":"xdg-terminal-exec --app-id=org.omarchy.terminal omarchy-pkg-aur-install"}, "install.preinstalls": {"icon":"󰏓","label":"Preinstalls","disabled":"[[ ! -f $HOME/.local/state/omarchy/preinstalls-removed ]]","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-preinstalls"}, + // An entry that installs from the AUR runs yay, which the image does not + // ship: it shows once yay is installed (#286). "install.browser.chromium": {"icon":"","label":"Chromium","disabled":"omarchy-pkg-present chromium","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser chromium'"}, "install.browser.chrome": {"icon":"","label":"Chrome","disabled":"omarchy-pkg-present google-chrome","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser chrome'"}, - "install.browser.edge": {"icon":"󰇩","label":"Edge","when":"omarchy-hw-x86","disabled":"omarchy-pkg-present microsoft-edge-stable-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser edge'"}, - "install.browser.brave": {"icon":"","label":"Brave","disabled":"omarchy-pkg-present brave-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser brave'"}, - "install.browser.brave-origin": {"icon":"","label":"Brave Origin","disabled":"omarchy-pkg-present brave-origin-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser brave-origin'"}, + "install.browser.edge": {"icon":"󰇩","label":"Edge","when":"omarchy-hw-x86 && omarchy-cmd-present yay","disabled":"omarchy-pkg-present microsoft-edge-stable-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser edge'"}, + "install.browser.brave": {"icon":"","label":"Brave","when":"omarchy-cmd-present yay","disabled":"omarchy-pkg-present brave-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser brave'"}, + "install.browser.brave-origin": {"icon":"","label":"Brave Origin","when":"omarchy-cmd-present yay","disabled":"omarchy-pkg-present brave-origin-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser brave-origin'"}, "install.browser.firefox": {"icon":"","label":"Firefox","disabled":"omarchy-pkg-present firefox","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser firefox'"}, - "install.browser.zen": {"icon":"󰖟","label":"Zen","disabled":"omarchy-pkg-present zen-browser-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser zen'"}, + "install.browser.zen": {"icon":"󰖟","label":"Zen","when":"omarchy-cmd-present yay","disabled":"omarchy-pkg-present zen-browser-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser zen'"}, "install.service.1password": {"icon":"󰢁","label":"1Password","disabled":"omarchy-pkg-present 1password","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-service-1password"}, "install.service.bitwarden": {"icon":"󰟵","label":"Bitwarden","disabled":"omarchy-pkg-present bitwarden","action":"omarchy-install-and-launch Bitwarden 'bitwarden bitwarden-cli' bitwarden"}, "install.service.dropbox": {"icon":"","label":"Dropbox","when":"[[ $(getconf PAGESIZE) == 4096 ]]","disabled":"omarchy-pkg-present dropbox","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-service-dropbox"}, @@ -342,7 +344,7 @@ "install.editor.sublime": {"icon":"","label":"Sublime Text","disabled":"omarchy-pkg-present sublime-text-4","action":"omarchy-install-and-launch 'Sublime Text' sublime-text-4 sublime_text"}, "install.editor.helix": {"icon":"","label":"Helix","disabled":"omarchy-pkg-present helix","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-editor-helix"}, "install.editor.vim": {"icon":"","label":"Vim","disabled":"omarchy-pkg-present vim","action":"omarchy-install-app Vim vim"}, - "install.editor.emacs": {"icon":"","label":"Emacs","disabled":"omarchy-pkg-present omarchy-emacs","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-editor-emacs"}, + "install.editor.emacs": {"icon":"","label":"Emacs","when":"omarchy-cmd-present yay","disabled":"omarchy-pkg-present omarchy-emacs","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-editor-emacs"}, "install.terminal.alacritty": {"icon":"","label":"Alacritty","disabled":"omarchy-pkg-present alacritty","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-terminal alacritty'"}, "install.terminal.foot": {"icon":"","label":"Foot","disabled":"omarchy-pkg-present foot","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-terminal foot'"}, "install.terminal.ghostty": {"icon":"","label":"Ghostty","disabled":"omarchy-pkg-present ghostty","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-terminal ghostty'"}, @@ -394,7 +396,7 @@ "install.development.elixir.phoenix": {"icon":"","label":"Phoenix","disabled":"compgen -G \"$HOME/.mix/archives/phx_new*\"","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-dev-env phoenix'"}, // Remove - "remove.package": {"icon":"󰣇","label":"Package","action":"xdg-terminal-exec --app-id=org.omarchy.terminal omarchy-pkg-remove"}, + "remove.package": {"icon":"󰣇","label":"Package","when":"omarchy-cmd-present yay","action":"xdg-terminal-exec --app-id=org.omarchy.terminal omarchy-pkg-remove"}, "remove.ai": {"icon":"󱚤","label":"AI","title":"Remove"}, "remove.dictation": {"icon":"","label":"Dictation","when":"omarchy-pkg-present voxtype-bin || omarchy-pkg-present superwhisper-bin || omarchy-pkg-present hex-bin"}, "remove.service": {"icon":"","label":"Services","title":"Remove"}, diff --git a/tests/test_menu_yay.py b/tests/test_menu_yay.py new file mode 100644 index 00000000..cbe348f8 --- /dev/null +++ b/tests/test_menu_yay.py @@ -0,0 +1,51 @@ +"""Menu entries whose commands run yay show only where yay is (#286).""" +import json +from pathlib import Path +import re +import unittest + +PROJECT = Path(__file__).resolve().parents[1] +MENU = PROJECT / 'desktop/shell/default/omarchy/omarchy-menu.jsonc' + +# Entry: why it needs yay (upstream's command at the pin). +NEEDS_YAY = { + 'install.browser.brave': 'omarchy-install-browser brave: omarchy-pkg-aur-add brave-bin', + 'install.browser.brave-origin': 'omarchy-install-browser brave-origin: omarchy-pkg-aur-add brave-origin-bin', + 'install.browser.zen': 'omarchy-install-browser zen: omarchy-pkg-aur-add zen-browser-bin', + 'install.aur': 'omarchy-pkg-aur-install: yay -Slqa', + 'install.editor.emacs': 'omarchy-install-editor-emacs: omarchy-pkg-aur-add omarchy-emacs', + 'remove.package': 'omarchy-pkg-remove: yay -Qqe', +} + + +def entry(name): + found = re.search(r'^\s*"' + re.escape(name) + r'":\s*(\{[^\n]+\})', MENU.read_text(), re.M) + return json.loads(found.group(1)) + + +class MenuYayTests(unittest.TestCase): + def test_aur_entries_show_only_with_yay(self): + for name, why in NEEDS_YAY.items(): + with self.subTest(name=name, why=why): + self.assertEqual(entry(name)['when'], 'omarchy-cmd-present yay') + + def test_edge_needs_x86_and_yay(self): + self.assertEqual(entry('install.browser.edge')['when'], 'omarchy-hw-x86 && omarchy-cmd-present yay') + + def test_repository_browsers_stay(self): + # Chromium and Firefox come from pacman's repositories. + for name in ('install.browser.chromium', 'install.browser.firefox'): + with self.subTest(name=name): + self.assertNotIn('when', entry(name)) + + def test_no_command_of_ours_runs_yay(self): + for script in (PROJECT / 'desktop/shell/bin').iterdir(): + if script.is_file(): + self.assertIsNone(re.search(r'\byay\b|omarchy-pkg-aur-', script.read_text(errors='replace')), script.name) + + def test_the_condition_command_is_ours(self): + self.assertTrue((PROJECT / 'desktop/shell/bin/omarchy-cmd-present').is_file()) + + +if __name__ == '__main__': + unittest.main() From af6e7c37804d937ae6923613fae5e68a2b75446d Mon Sep 17 00:00:00 2001 From: Jan-Arve Nygard Date: Fri, 4 Dec 2026 13:06:17 +0000 Subject: [PATCH 2/2] Changelog: the menu's AUR entries show only where yay is Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SLbz23ZoimaemGQ2yfdfhR --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67f4ea04..22b887fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ release is checked here and released on by hand. ### Desktop +- Install > Browser and the other menu entries that install from the AUR + (Brave, Zen, Emacs, Install > AUR, Remove > Package) show only once yay + is installed, instead of failing with "yay: command not found". + - Actions that need the password ask for it: choosing Cloudflare or Google as DNS provider or setting up Tailscale did nothing before. Tapping the password field brings the on-screen keyboard back after it was put away,