diff --git a/default/omarchy/omarchy-menu.jsonc b/default/omarchy/omarchy-menu.jsonc index a8eea0f1..a697c402 100644 --- a/default/omarchy/omarchy-menu.jsonc +++ b/default/omarchy/omarchy-menu.jsonc @@ -61,7 +61,16 @@ "trigger.toggle.crash-capture": {"icon":"󱚡","label":"Crash Capture","action":"omarchy-toggle-crash-capture"}, "trigger.appearance": {"icon":"󰏘","label":"Appearance"}, "trigger.appearance.animations": {"icon":"󰗘","label":"Animations","action":"omarchy-toggle-animations"}, - "trigger.appearance.top-bar": {"icon":"󰍜","label":"Menu Bar","action":"omarchy-toggle-bar"}, + "trigger.appearance.top-bar": {"icon":"󰍜","label":"Menu Bar"}, + "trigger.appearance.top-bar.hide": {"icon":"󰈉","label":"Hide Bar","when":"! omarchy-toggle-enabled bar-off","action":"omarchy-toggle-bar"}, + "trigger.appearance.top-bar.show": {"icon":"󰈈","label":"Show Bar","when":"omarchy-toggle-enabled bar-off","action":"omarchy-toggle-bar"}, + "trigger.appearance.top-bar.position": {"icon":"","label":"Position Bar"}, + "trigger.appearance.top-bar.transparent": {"icon":"󰂵","label":"Transparent Bar","when":"! jq -e .bar.transparent ~/.config/omarchy/shell.json >/dev/null 2>&1","action":"omarchy-bar transparent true"}, + "trigger.appearance.top-bar.opaque": {"icon":"󰂵","label":"Opaque Bar","when":"jq -e .bar.transparent ~/.config/omarchy/shell.json >/dev/null 2>&1","action":"omarchy-bar transparent false"}, + "trigger.appearance.top-bar.position.top": {"icon":"󰁝","label":"Top Bar","action":"omarchy-bar position top"}, + "trigger.appearance.top-bar.position.bottom": {"icon":"󰁅","label":"Bottom Bar","action":"omarchy-bar position bottom"}, + "trigger.appearance.top-bar.position.left": {"icon":"󰁍","label":"Left Bar","action":"omarchy-bar position left"}, + "trigger.appearance.top-bar.position.right": {"icon":"󰁔","label":"Right Bar","action":"omarchy-bar position right"}, "trigger.appearance.battery-percentage": {"icon":"󰁹","label":"Battery Percentage","when":"omarchy-hw-laptop","action":"omarchy-shell omarchy.power togglePercentage"}, "trigger.appearance.window-gaps": {"icon":"","label":"Window Gaps","action":"omarchy-hyprland-window-gaps-toggle"}, "trigger.appearance.one-window-ratio": {"icon":"","label":"1-Window Ratio","action":"omarchy-hyprland-window-single-square-aspect-toggle"}, @@ -112,16 +121,9 @@ "style.background": {"icon":"","label":"Background","aliases":["background","wallpaper"],"action":"background=$(omarchy-theme-bg-switcher); [[ -n $background ]] && omarchy-theme-bg-set \"$background\""}, "style.unlock": {"icon":"󰟵","label":"Unlock","aliases":["unlock"],"action":"unlock=$(omarchy-plymouth-switcher); if [[ $unlock == default ]]; then omarchy-launch-floating-terminal-with-presentation omarchy-plymouth-reset; elif [[ -n $unlock ]]; then omarchy-launch-floating-terminal-with-presentation \"omarchy-plymouth-set-by-theme $(printf %q \"$unlock\")\"; fi"}, "style.font": {"icon":"","label":"Font","provider":"fonts"}, - "style.bar": {"icon":"󰍜","label":"Menu Bar"}, - "style.bar.position": {"icon":"","label":"Position"}, - "style.bar.transparency": {"icon":"󰂵","label":"Transparency","action":"omarchy-bar transparent toggle"}, "style.hyprland": {"icon":"","label":"Hyprland","action":"omarchy-launch-config-editor \"$HOME/.config/hypr/looknfeel.lua\""}, "style.screensaver": {"icon":"󱄄","label":"Screensaver"}, "style.about": {"icon":"","label":"About"}, - "style.bar.position.top": {"icon":"󰁝","label":"Top","action":"omarchy-bar position top"}, - "style.bar.position.bottom": {"icon":"󰁅","label":"Bottom","action":"omarchy-bar position bottom"}, - "style.bar.position.left": {"icon":"󰁍","label":"Left","action":"omarchy-bar position left"}, - "style.bar.position.right": {"icon":"󰁔","label":"Right","action":"omarchy-bar position right"}, "style.about.text": {"icon":"","label":"Edit Text","action":"omarchy-branding-about text"}, "style.about.image": {"icon":"","label":"Set From Image","action":"omarchy-branding-about image"}, "style.about.default": {"icon":"","label":"Restore Default","action":"omarchy-branding-about reset"}, diff --git a/test/shell.d/menu-test.sh b/test/shell.d/menu-test.sh index 71357343..a7584920 100644 --- a/test/shell.d/menu-test.sh +++ b/test/shell.d/menu-test.sh @@ -194,8 +194,8 @@ assert( const triggerItems = defaultItems.filter(item => item.parent === 'trigger') assertEqual( triggerItems[0].id, - 'trigger.emoji', - 'menu lists Emoji first under Trigger' + 'trigger.toggle', + 'menu lists Toggle first under Trigger' ) assertEqual( defaultById['trigger.emoji'].action, @@ -363,21 +363,40 @@ assert( !defaultById['trigger.toggle.direct-boot'] && !defaultById['trigger.toggle.passwordless-sudo'], 'menu removes the relocated toggles from Trigger > Toggle' ) +assertDeepEqual( + defaultItems.filter(item => item.parent === 'trigger.appearance.top-bar').map(item => item.label), + ['Hide Bar', 'Show Bar', 'Position Bar', 'Transparent Bar', 'Opaque Bar'], + 'menu gathers the Menu Bar under Trigger > Appearance' +) assert( - defaultById['style.bar.position'].kind === 'menu', + defaultById['trigger.appearance.top-bar.hide'].when === '! omarchy-toggle-enabled bar-off' + && defaultById['trigger.appearance.top-bar.show'].when === 'omarchy-toggle-enabled bar-off' + && defaultById['trigger.appearance.top-bar.hide'].action === 'omarchy-toggle-bar' + && defaultById['trigger.appearance.top-bar.show'].action === 'omarchy-toggle-bar', + 'menu offers Hide while the Menu Bar shows and Show while it is hidden' +) +assert(!defaultItems.some(item => item.id.startsWith('style.bar')), 'menu no longer keeps the Menu Bar under Style') +assert( + defaultById['trigger.appearance.top-bar.position'].kind === 'menu', 'menu groups Menu Bar positions in a submenu' ) assert( - ['top', 'bottom', 'left', 'right'].every(position => defaultById[`style.bar.position.${position}`].action === `omarchy-bar position ${position}`), + ['top', 'bottom', 'left', 'right'].every(position => defaultById[`trigger.appearance.top-bar.position.${position}`].action === `omarchy-bar position ${position}`), 'menu lists all Menu Bar positions under Position' ) -assertEqual( - defaultById['style.bar.transparency'].action, - 'omarchy-bar transparent toggle', - 'menu exposes Menu Bar transparency as a toggle' +assert( + defaultById['trigger.appearance.top-bar.transparent'].action === 'omarchy-bar transparent true' + && defaultById['trigger.appearance.top-bar.opaque'].action === 'omarchy-bar transparent false' + && defaultById['trigger.appearance.top-bar.transparent'].when === '! ' + defaultById['trigger.appearance.top-bar.opaque'].when, + 'menu offers Transparent Bar while the bar is opaque and Opaque Bar while it is transparent' +) +assertDeepEqual( + ['top', 'bottom', 'left', 'right'].map(position => defaultById[`trigger.appearance.top-bar.position.${position}`].label), + ['Top Bar', 'Bottom Bar', 'Left Bar', 'Right Bar'], + 'menu names each position after the bar' ) const triggerIds = triggerItems.map(item => item.id) -const appearanceLabels = ['Menu Bar', 'Battery Percentage', 'Workspace Layout', 'Window Gaps', 'Animations', '1-Window Ratio'] +const appearanceLabels = ['Animations', 'Menu Bar', 'Battery Percentage', 'Window Gaps', '1-Window Ratio', 'Workspace Layout', 'Herdr Theme Sync'] assertEqual(triggerIds.indexOf('trigger.appearance'), triggerIds.indexOf('trigger.toggle') + 1, 'menu places Appearance right after Toggle') assertDeepEqual( defaultItems.filter(item => item.parent === 'trigger.appearance').map(item => item.label),