Group bar position under Style > Menu Bar and add transparency toggle
omarchy bar transparent now accepts toggle, flipping the current value in one jq update (absent counts as opaque, matching the shell). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
dc71875ada
commit
c70ae3a405
+10
-5
@@ -2,7 +2,7 @@
|
||||
|
||||
# omarchy:summary=Set the active bar option, position, and transparency
|
||||
# omarchy:group=bar
|
||||
# omarchy:args=use <id> | reset | defaults | position <top|bottom|left|right> | transparent <true|false>
|
||||
# omarchy:args=use <id> | reset | defaults | position <top|bottom|left|right> | transparent <true|false|toggle>
|
||||
# omarchy:examples=omarchy bar use local.neon-bar | omarchy bar reset | omarchy bar defaults | omarchy bar position top | omarchy bar transparent true
|
||||
|
||||
set -euo pipefail
|
||||
@@ -19,7 +19,7 @@ Usage: omarchy bar <command> [args...]
|
||||
reset Return to the built-in Omarchy bar
|
||||
defaults Restore the default bar and service widgets
|
||||
position <top|bottom|left|right> Bar position
|
||||
transparent <true|false> Bar transparency
|
||||
transparent <true|false|toggle> Bar transparency
|
||||
|
||||
Bar widgets are added, moved, removed, and configured with 'omarchy bar plugin'.
|
||||
|
||||
@@ -140,9 +140,14 @@ cmd_transparent() {
|
||||
local transparent="${1:-}"
|
||||
[[ -n $transparent ]] || fail "transparent is required"
|
||||
[[ $# -eq 1 ]] || fail "transparent takes a single value"
|
||||
[[ $transparent =~ ^(true|false)$ ]] || fail "transparent must be true or false"
|
||||
commit "$NORMALIZE | .bar.transparent = \$transparent" --argjson transparent "$transparent"
|
||||
echo "Bar transparency set to $transparent"
|
||||
[[ $transparent =~ ^(true|false|toggle)$ ]] || fail "transparent must be true, false, or toggle"
|
||||
if [[ $transparent == "toggle" ]]; then
|
||||
commit "$NORMALIZE | .bar.transparent = (.bar.transparent != true)"
|
||||
echo "Bar transparency toggled"
|
||||
else
|
||||
commit "$NORMALIZE | .bar.transparent = \$transparent" --argjson transparent "$transparent"
|
||||
echo "Bar transparency set to $transparent"
|
||||
fi
|
||||
}
|
||||
|
||||
# --------------------------------------------------------------------- dispatch
|
||||
|
||||
@@ -88,15 +88,17 @@
|
||||
"style.theme": {"icon":"","label":"Theme","aliases":["theme","themes"],"keywords":"colors","action":"theme=$(omarchy-theme-switcher); [[ -n $theme ]] && omarchy-theme-set \"$theme\""},
|
||||
"style.background": {"icon":"","label":"Background","aliases":["background","wallpaper"],"action":"background=$(omarchy-theme-bg-switcher); [[ -n $background ]] && omarchy-theme-bg-set \"$background\""},
|
||||
"style.font": {"icon":"","label":"Font","keywords":"typeface","provider":"fonts"},
|
||||
"style.bar": {"icon":"","label":"Bar","keywords":"quickshell top bottom left right settings"},
|
||||
"style.bar": {"icon":"","label":"Menu Bar","keywords":"quickshell top bottom left right settings"},
|
||||
"style.bar.position": {"icon":"","label":"Position"},
|
||||
"style.bar.transparency": {"icon":"","label":"Transparency","action":"omarchy-bar transparent toggle"},
|
||||
"style.hyprland": {"icon":"","label":"Hyprland","keywords":"look feel","action":"omarchy-launch-config-editor \"$HOME/.config/hypr/looknfeel.lua\""},
|
||||
"style.screensaver": {"icon":"","label":"Screensaver","keywords":"branding"},
|
||||
"style.about": {"icon":"","label":"About","keywords":"branding"},
|
||||
"style.install": {"icon":"","label":"Install","keywords":"theme background font"},
|
||||
"style.bar.top": {"icon":"","label":"Top","keywords":"position","action":"omarchy-bar position top"},
|
||||
"style.bar.bottom": {"icon":"","label":"Bottom","keywords":"position","action":"omarchy-bar position bottom"},
|
||||
"style.bar.left": {"icon":"","label":"Left","keywords":"position","action":"omarchy-bar position left"},
|
||||
"style.bar.right": {"icon":"","label":"Right","keywords":"position","action":"omarchy-bar position right"},
|
||||
"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","keywords":"branding","action":"omarchy-branding-about text"},
|
||||
"style.about.image": {"icon":"","label":"Set From Image","keywords":"branding","action":"omarchy-branding-about image"},
|
||||
"style.about.default": {"icon":"","label":"Restore Default","keywords":"branding","action":"omarchy-branding-about reset"},
|
||||
|
||||
@@ -269,6 +269,10 @@ jq -e '
|
||||
' "$TMPDIR/home/.config/omarchy/shell.json" >/dev/null
|
||||
pass "shell config sets bar transparency"
|
||||
|
||||
HOME="$TMPDIR/home" OMARCHY_PATH="$ROOT" omarchy-bar transparent toggle
|
||||
jq -e '.bar.transparent == false' "$TMPDIR/home/.config/omarchy/shell.json" >/dev/null
|
||||
pass "shell config toggles bar transparency"
|
||||
|
||||
HOME="$TMPDIR/home" OMARCHY_PATH="$ROOT" omarchy-bar-plugin drop omarchy.active-window
|
||||
jq -e '
|
||||
def ids: map(.id // .);
|
||||
|
||||
@@ -136,6 +136,19 @@ assert(
|
||||
!defaultById['trigger.toggle.direct-boot'] && !defaultById['trigger.toggle.passwordless-sudo'],
|
||||
'menu removes the relocated toggles from Trigger > Toggle'
|
||||
)
|
||||
assert(
|
||||
defaultById['style.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}`),
|
||||
'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'
|
||||
)
|
||||
assertEqual(
|
||||
defaultById['trigger.hardware.laptop-display'].when,
|
||||
'omarchy-hw-laptop',
|
||||
|
||||
Reference in New Issue
Block a user