Skip to content

Commit 09b955d

Browse files
dhhclaude
andauthored
Manage plugins from Setup > Plugins (omacom#6420)
* Give built-in plugins an honest on/off state Every built-in reported itself enabled no matter what. A bar widget said "enabled" while sitting nowhere near the bar, and disabling a built-in service silently did nothing, because enabled meant "listed in plugins[]" and a built-in never is. Nothing surfaced that, since the only caller listing plugins was the CLI. For a widget, on and off is its place in the bar, so listPlugins reports layout membership -- what enable/disable actually toggles. For everything else built in, loading by default is the right behaviour to keep, so switching one off is recorded the other way round, in disabledPlugins[]. shell.json still carries only the deviation from the defaults: the key is dropped the moment nothing is switched off, leaving a config that never disabled anything byte-identical. isEnabled still answers a separate question -- whether the component loads at all -- and deliberately does not follow a widget out of the bar. omarchy.menu is both a widget and the menu itself, so tying the two together would let taking its button off the bar lock the menu out of the shell, with no way back that isn't the CLI. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Manage plugins from Setup > Plugins Plugins were CLI-only. Setup > Plugins now offers Enable, Disable, Add, and Remove, each list living in the menu itself so picking a row acts on it. Enable and Disable cover the built-ins as well as anything installed -- the bar widgets you can put in the bar, the services and overlays you can switch off. Remove is limited to plugins the user installed, since a built-in has no checkout to delete, and stays hidden until there is one. Whole-bar replacements are left out; those are chosen under Style. Enabling a bar widget asks for a section first, because enabling alone drops it on the right and the only way to move it was a follow-up bar plugin move. The CLI asks the same question after its own add, so both paths place a widget the same way. Add and Remove run in a terminal: one needs a git URL and shows the trust warning before cloning, the other deletes a checkout and prints where it backed it up. Providers grew two hooks for this. placementFor turns a row into a submenu instead of an action, and volatile re-runs the enumeration when its submenu is entered -- picking from these lists is what changes them, and rows a provider no longer returns now drop out instead of lingering forever. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Trim the plugin menu after review Menu.qml carried its own shellQuote while already importing Util and calling Util.shellQuote a few lines up; two copies of the same escaping is one place for a future fix to miss. isDisabled walked the array by hand to compare values it writes itself, and dropDisabled was an eight-line helper with one caller. Two bugs came out of the same pass. A whole-bar replacement belongs under Style rather than these lists, but the exclusion sat in the shared row builder, so a third-party bar could be installed and never removed -- Remove would show an empty list under a guard that said something was there. The exclusion now sits on the two lists that mean it. Rows are keyed by id, and distinct plugin ids can slugify alike: acme.foo, acme_foo and acme-foo all give acme-foo. The merge keeps the first row per id, so the rest simply vanished from the list with nothing to say why. Row ids are now made distinct before merging. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Pick a plugin the way we pick a theme Setup > Plugins listed plugins as menu rows, which needed three providers, a placement submenu, a volatile-refresh hook and a row-swap in the merge. Only Font and Apps are built that way. Theme, Background, Unlock, Timezone and Keybindings all pipe a list into omarchy-menu-select instead, which is one action string and a small script -- so that is what these use now. The trade is search: a plugin name is no longer findable from the root prompt. Neither is a theme name or a timezone, and Enable Plugin still is, so the loss sits where the rest of the menu already puts it. Two pieces of the row machinery stay, because they are worth having for the lists that remain. A volatile provider re-runs when its submenu is entered, so a font installed since the shell started now shows up without restarting it, and rows a provider stops returning drop out. Row ids are still made distinct before merging: Fira Code and Fira-Code both slug to fira-code, and a repeated id was silently dropped. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Let a picked option carry an icon Moving the plugin lists onto omarchy-menu-select cost them their glyphs: the select mode has always hardcoded an empty icon, which is why Timezone and Keybindings have none either. An option may now lead with one, as "<glyph><TAB><label>". The menu shows the glyph, filters on the label, and hands the label back, so a caller never strips a glyph off its own selection and a list of plain strings behaves exactly as before. The plugin picker uses it for the puzzle glyph on each plugin and the align glyphs on the sections, which also regain the capitals they lost when the section names were passed through raw. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Switch bars by enabling one A bar option was kept out of Enable and Disable on the grounds that picking which bar to run belongs under Style -- but nothing under Style ever offered it, so an installed bar could be added and removed and never actually put to use. The menu was guarding a door to a room that was never built. Enabling one is the switch. setEnabled already assigns bar.id for a bar option, so a bar has always replaced the one before it; only the picker's filter stood in the way. Dropping it costs nothing else, because enabled for a bar option means active: the bar in use is the one row absent from Enable, every other installed bar is one pick away, and the built-in is just another entry, so going back to it is enabling Bar. Disable keeps the exclusion. That is the one verb a bar cannot answer -- there is no off, only a successor -- and offering it would have listed the built-in bar on a stock system, where turning it off deletes a bar.id that was never set and nothing happens. A bar carries the bar glyph rather than the puzzle one, so a row that replaces the whole bar does not read like one more widget to switch on, and enable now says "Now using X as the bar" instead of "Enabled X", which understated a whole-bar swap in both the enable and the freshly-added path. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Refuse a plugin that declares a kind it cannot load A kind is a promise to supply something to load, and the shell reads that something from a fixed key: entryPoints.bar to draw a bar, entryPoints.menu to open a menu. Nothing checked the promise. A manifest could claim kinds ["bar"] with no bar entry point, pass validation, install, and enable -- and then the bar would fall back to the built-in and the widget would be skipped, leaving a plugin that does nothing, explained only by a console.warn nobody reads. Our own plugins have been held to this table by plugins-test.sh all along. This holds third-party ones to the same table, at add and update time, where there is still someone to tell. A kind outside the table is left alone rather than guessed at, so a shell that learns a new kind does not need this list updated first. The cost is that a misspelled kind still installs quietly. omarchy-plugin-validate had no tests; it has some now. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Act on the plugin whose row was picked The picker showed a name and then looked that name up again across every plugin, filtered set or not, taking the first match. Two plugins can share a name: cloning one keeps the name it was cloned from, so the documented `omarchy plugin clone omarchy.clock local.clock` leaves two plugins called Clock. Enable listed the clone -- the built-in was already enabled, so only the clone was eligible -- and then enabled omarchy.clock, moving the built-in widget instead. Remove listed the clone and tried to delete a built-in that has no checkout to delete. A row now carries its id alongside its label, and the id is read back off the row that was picked instead of being derived from the name a second time. Where a name is not unique among the rows on offer, the label carries the id too, so two rows that would both say Clock can be told apart at all -- which they could not before, whichever one the pick resolved to. The verb prompt only ever sees the first two fields, so the menu shows what it always did. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Never ask a bar where to sit in the bar A manifest may declare both bar and bar-widget, and validation accepts it. The picker saw bar-widget, asked for a section, and passed it to enable. setEnabled takes bar as the dominant kind: it writes bar.id and returns, adding nothing to any layout, so the move that followed had no widget to find and failed -- after the bar had already been switched. A partial success with an error on the way out. Bar wins ahead of bar-widget now, in the picker and in the placement prompt `plugin add --enable` asks, so a bar is enabled without a placement it cannot use. The CLI refuses a placement on a bar outright, before the bar is switched rather than after, since `omarchy plugin enable <bar> --section left` could reach the same half-applied state without going through either. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Only replacement, no off * Add default placement for bar widgets * Simplify plugin menu actions * Document plugin placement behavior * Allow dropping widgets in empty bar space * Treat plugin dependencies as runtime invariants * Reject duplicate plugin ids on add --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 6593403 commit 09b955d

27 files changed

Lines changed: 1007 additions & 154 deletions

‎bin/omarchy-bar-plugin‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,13 @@ widget_is_known() {
121121
' >/dev/null
122122
}
123123

124+
widget_default_section() {
125+
omarchy-plugin-catalog | jq -r --arg id "$1" '
126+
(map(select(.id == $id))[0].barWidget.defaultSection // "center") as $section
127+
| if ["left", "center", "right"] | index($section) then $section else "center" end
128+
'
129+
}
130+
124131
# --------------------------------------------------------------------- placement
125132

126133
# Parse placement flags shared by add/move/remove/set. Sets the globals below.
@@ -217,7 +224,7 @@ cmd_add() {
217224

218225
widget_is_known "$id" || fail "$id is not a known bar widget; run 'omarchy plugin list' to see valid ids"
219226

220-
local default_section="${PLACEMENT_SECTION:-right}"
227+
local default_section="${PLACEMENT_SECTION:-$(widget_default_section "$id")}"
221228
local explicit="false"
222229
if [[ -n $PLACEMENT_INDEX || -n $PLACEMENT_BEFORE || -n $PLACEMENT_AFTER || $PLACEMENT_DUPLICATE == true ]]; then
223230
explicit="true"

‎bin/omarchy-menu-plugin‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
# omarchy:summary=Pick a shell plugin to enable, disable, or remove
4+
# omarchy:group=menu
5+
# omarchy:name=plugin
6+
# omarchy:args=<enable|disable|remove>
7+
# omarchy:examples=omarchy menu plugin enable | omarchy menu plugin disable
8+
9+
set -euo pipefail
10+
11+
PLUGIN_ICON=$'\U000f0431'
12+
13+
case "${1:-}" in
14+
enable) filter='(.enabled | not)' ;;
15+
disable) filter='.canDisable and .enabled' ;;
16+
remove) filter='(.firstParty | not)' ;;
17+
*)
18+
echo "Usage: omarchy-menu-plugin <enable|disable|remove>" >&2
19+
exit 1
20+
;;
21+
esac
22+
23+
plugins=$(omarchy-plugin list --json) || exit 1
24+
25+
# Two plugins may share a name, so keep the id with the row and show it when the
26+
# name alone cannot identify the pick.
27+
rows=$(jq -r --arg icon "$PLUGIN_ICON" \
28+
"([.[] | select($filter)]) as \$rows
29+
| \$rows[]
30+
| .name as \$name
31+
| (if ([\$rows[] | select(.name == \$name)] | length) > 1 then \$name + \" (\" + .id + \")\" else \$name end) as \$label
32+
| \$icon + \"\\t\" + \$label + \"\\t\" + .id" <<<"$plugins")
33+
[[ -n $rows ]] || { omarchy-notification-send "No plugin to ${1}"; exit 0; }
34+
35+
name=$(omarchy-menu-select "${1^} plugin" < <(cut -f1,2 <<<"$rows")) || exit 0
36+
[[ -n $name ]] || exit 0
37+
38+
id=$(awk -F'\t' -v label="$name" '$2 == label { print $3; exit }' <<<"$rows")
39+
[[ -n $id ]] || exit 1
40+
41+
if [[ $1 == "remove" ]]; then
42+
omarchy-launch-floating-terminal-with-presentation "omarchy-plugin remove $(printf '%q' "$id")"
43+
else
44+
omarchy-plugin "$1" "$id"
45+
fi

‎bin/omarchy-menu-select‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
# omarchy:args=prompt [option...] [-- menu args...]
77
# omarchy:examples=omarchy menu select Format jpg png|omarchy-menu-select Resolution 4k 1080p 720p -- --width 400
88

9+
# An option may lead with an icon, as "<glyph><TAB><label>". The menu shows the
10+
# glyph and returns the label alone, so callers never strip it back off.
11+
912
set -euo pipefail
1013

1114
if (( $# < 1 )); then

‎bin/omarchy-plugin‎

Lines changed: 61 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Usage: omarchy-plugin <command> [args...]
2121
Manage plugins:
2222
list [--json] List discovered shell plugins
2323
rescan Rescan ~/.config/omarchy/plugins
24-
enable <id> [placement] Enable a plugin
24+
enable <id> [placement] Enable a plugin (a bar replaces the one in use)
2525
disable <id> Disable a plugin
2626
2727
Install from git (a plugin is a git repo):
@@ -51,10 +51,6 @@ fail() {
5151
exit 1
5252
}
5353

54-
require_command() {
55-
omarchy-cmd-present "$1" || fail "$1 is required"
56-
}
57-
5854
interactive() {
5955
[[ -t 0 && -t 1 ]]
6056
}
@@ -78,10 +74,50 @@ valid_plugin_id() {
7874
[[ $1 =~ ^[A-Za-z0-9][A-Za-z0-9._-]*$ && $1 != *..* ]]
7975
}
8076

77+
is_bar_option() {
78+
omarchy-plugin-catalog | jq -e --arg id "$1" 'any(.[]; .id == $id and (.kinds | index("bar")))' >/dev/null
79+
}
80+
81+
# Only one bar runs at a time, so enabling one replaces the one before it. Say
82+
# that rather than "Enabled", which reads like one more thing switched on next
83+
# to everything already there.
84+
enabled_message() {
85+
local id="$1"
86+
if is_bar_option "$id"; then
87+
echo "Now using $id as the bar"
88+
else
89+
echo "Enabled $id"
90+
fi
91+
}
92+
93+
# A bar widget lands on the right when it is enabled, which is rarely where it
94+
# belongs. Ask once, here, rather than leaving a follow-up 'omarchy bar plugin
95+
# move' as the only way to place it.
96+
place_bar_widget() {
97+
local id="$1" section default_section
98+
interactive || return 0
99+
(( ASSUME_YES )) && return 0
100+
# A plugin that is also a bar has no place in the layout to ask about.
101+
jq -e '(.kinds // []) | (index("bar") | not) and (index("bar-widget") != null)' \
102+
"$PLUGINS_DIR/$id/manifest.json" >/dev/null 2>&1 || return 0
103+
104+
default_section=$(jq -r '.barWidget.defaultSection // "center"' "$PLUGINS_DIR/$id/manifest.json")
105+
section=$(printf '%s\n' left center right |
106+
gum choose --header="Place $id in which bar section?" --selected "$default_section") || return 0
107+
[[ -n $section ]] || return 0
108+
omarchy-bar-plugin move "$id" --section "$section" >/dev/null && echo "Placed $id in the $section section"
109+
}
110+
81111
installed_plugin_ids() {
82112
find "$PLUGINS_DIR" -mindepth 1 -maxdepth 1 \( -type d -o -type l \) ! -name '.*' -printf '%f\n' 2>/dev/null | sort
83113
}
84114

115+
plugin_id_manifest() {
116+
omarchy-plugin-catalog | jq -r --arg id "$1" '
117+
map(select(.id == $id))[0].manifestPath // empty
118+
'
119+
}
120+
85121
plugin_discovered() {
86122
local id="$1" plugins
87123
plugins=$(omarchy-shell shell listPlugins 2>/dev/null) || return 1
@@ -124,7 +160,6 @@ print_plugins() {
124160
return
125161
fi
126162

127-
require_command jq
128163
jq -r '
129164
sort_by(.id)[] |
130165
[ .id,
@@ -155,9 +190,15 @@ plugin_enabled() {
155190
fail "disable does not take placement options"
156191
fi
157192

193+
# Enabling a bar writes bar.id and touches no layout, so a placement could
194+
# only be applied to a widget that is not there. Refuse before the bar is
195+
# switched, rather than switching it and failing on the move afterwards.
196+
if [[ $enabled == "true" ]] && (( $# > 0 )) && is_bar_option "$id"; then
197+
fail "'$id' is a bar; it replaces the bar in use rather than taking a place in one"
198+
fi
199+
158200
omarchy-shell shell rescanPlugins >/dev/null 2>&1 || true
159201
if [[ $enabled == "true" ]]; then
160-
require_command jq
161202
wait_for_plugin_discovery "$id" || fail "plugin '$id' was not discovered; is omarchy-shell running?"
162203
fi
163204

@@ -169,7 +210,7 @@ plugin_enabled() {
169210
omarchy-bar-plugin move "$id" "$@"
170211
echo "Enabled and moved $id"
171212
elif [[ $enabled == "true" ]]; then
172-
echo "Enabled $id"
213+
enabled_message "$id"
173214
else
174215
echo "Disabled $id"
175216
fi
@@ -178,9 +219,6 @@ plugin_enabled() {
178219
# ---------------------------------------------------------------- add
179220

180221
plugin_add() {
181-
require_command git
182-
require_command jq
183-
184222
local url="" enable_after=""
185223
while (( $# > 0 )); do
186224
case "$1" in
@@ -230,8 +268,17 @@ WARN
230268
fail "refusing to add: validation failed"
231269
fi
232270

233-
local id
271+
local id existing_manifest
234272
id=$(jq -r '.id' "$stage/manifest.json")
273+
existing_manifest=$(plugin_id_manifest "$id") || {
274+
rm -rf "$stage"
275+
fail "could not inspect installed plugin ids"
276+
}
277+
if [[ -n $existing_manifest ]]; then
278+
rm -rf "$stage"
279+
fail "plugin id '$id' is already used by $existing_manifest"
280+
fi
281+
235282
local target="$PLUGINS_DIR/$id"
236283
if [[ -e $target || -L $target ]]; then
237284
rm -rf "$stage"
@@ -254,7 +301,8 @@ WARN
254301

255302
if [[ $enable_after == true ]]; then
256303
if wait_for_plugin_discovery "$id" && [[ $(omarchy-shell shell setPluginEnabled "$id" true) == "ok" ]]; then
257-
echo "Enabled $id"
304+
enabled_message "$id"
305+
place_bar_widget "$id"
258306
else
259307
echo "Could not enable $id (is omarchy-shell running?). Enable later with: omarchy plugin enable $id" >&2
260308
fi
@@ -310,8 +358,6 @@ update_one() {
310358
}
311359

312360
plugin_update() {
313-
require_command git
314-
315361
local id="" all=0
316362
while (( $# > 0 )); do
317363
case "$1" in

‎bin/omarchy-plugin-catalog‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
set -o pipefail
1616

1717
OMARCHY_PATH="${OMARCHY_PATH:-}"
18-
omarchy-cmd-present jq || { echo "omarchy-plugin-catalog: jq is required" >&2; exit 1; }
1918

2019
paths=()
2120

@@ -29,7 +28,8 @@ user_dir="$HOME/.config/omarchy/plugins"
2928
if [[ -d $user_dir ]]; then
3029
while IFS= read -r manifest; do
3130
paths+=("$manifest")
32-
done < <(find -L "$user_dir" -mindepth 2 -maxdepth 2 -type f -name manifest.json 2>/dev/null | sort)
31+
done < <(find -L "$user_dir" -mindepth 2 -maxdepth 2 -type f -name manifest.json \
32+
! -path "$user_dir/.*/*" 2>/dev/null | sort)
3333
fi
3434

3535
if (( ${#paths[@]} == 0 )); then

‎bin/omarchy-plugin-clone‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ fail() {
1414
exit 1
1515
}
1616

17-
require_command() {
18-
omarchy-cmd-present "$1" || fail "$1 is required"
19-
}
20-
2117
require_omarchy_path() {
2218
[[ -n ${OMARCHY_PATH:-} ]] || fail "OMARCHY_PATH is not set"
2319
}
@@ -39,7 +35,6 @@ validate_plugin_id() {
3935

4036
catalog_json() {
4137
require_omarchy_path
42-
require_command jq
4338
omarchy-plugin-catalog
4439
}
4540

@@ -224,8 +219,6 @@ USAGE
224219
}
225220

226221
clone_command() {
227-
require_command jq
228-
require_command python3
229222
require_omarchy_path
230223

231224
local source_id=""

‎bin/omarchy-plugin-validate‎

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,13 @@ if [[ ${1:-} == -h || ${1:-} == --help ]]; then
2121
Usage: omarchy plugin validate <plugin-folder>
2222
2323
Checks a plugin folder's manifest.json against the schema the shell enforces:
24-
schemaVersion, required fields, safe relative entry points that exist, no
25-
symlinks, and an id that is not reserved. Exits 0 if valid — handy for plugin
26-
authors before publishing.
24+
schemaVersion, required fields, safe relative entry points that exist, an entry
25+
point for each kind that needs one, no symlinks, and an id that is not reserved.
26+
Exits 0 if valid — handy for plugin authors before publishing.
2727
USAGE
2828
exit 0
2929
fi
3030

31-
omarchy-cmd-present jq || fail "jq is required"
32-
3331
PLUGIN_DIR="${1:-}"
3432
[[ -n $PLUGIN_DIR && -d $PLUGIN_DIR ]] || fail "plugin folder not found: ${PLUGIN_DIR:-<none>}"
3533

@@ -62,6 +60,19 @@ jq -e '(.kinds | type) == "array" and (.kinds | length) > 0' "$MANIFEST" >/dev/n
6260
jq -e '(.entryPoints | type) == "object"' "$MANIFEST" >/dev/null 2>&1 \
6361
|| fail "'entryPoints' must be an object"
6462

63+
# A bar widget may declare where it should land when enabled without an
64+
# explicit placement.
65+
jq -e '
66+
if ((.barWidget? | type) == "object" and (.barWidget | has("defaultSection"))) then
67+
.barWidget.defaultSection as $section
68+
| ($section | type) == "string"
69+
and (["left", "center", "right"] | index($section)) != null
70+
else
71+
true
72+
end
73+
' "$MANIFEST" >/dev/null 2>&1 \
74+
|| fail "'barWidget.defaultSection' must be left, center, or right"
75+
6576
# Read each entry point as a JSON-encoded string (one per line), then decode it,
6677
# so a value that itself contains a newline stays one literal path instead of
6778
# being split into fragments that each pass the checks.
@@ -75,6 +86,28 @@ while IFS= read -r ep_json; do
7586
[[ -f "$PLUGIN_DIR/$ep" ]] || fail "entry point file not found: '$ep'"
7687
done < <(jq -c '.entryPoints | to_entries[] | .value' "$MANIFEST")
7788

89+
# A kind is a promise to supply something to load, and the shell looks for that
90+
# something under a fixed key: entryPoints.bar to draw a bar, entryPoints.menu
91+
# to open a menu, and so on. Claiming a kind without its entry point is accepted
92+
# everywhere else -- the bar falls back to the built-in, the widget is skipped --
93+
# leaving a plugin that installs, enables, and does nothing, explained only by a
94+
# line on the shell's console. Refuse it here, while there is still someone to
95+
# tell. First-party plugins are held to the same table in plugins-test.sh; a kind
96+
# not listed is left alone rather than guessed at.
97+
for kind_entry_point in \
98+
"bar:bar" \
99+
"bar-widget:barWidget" \
100+
"menu:menu" \
101+
"overlay:overlay" \
102+
"panel:panel" \
103+
"service:service"; do
104+
kind="${kind_entry_point%%:*}"
105+
entry_point="${kind_entry_point##*:}"
106+
jq -e --arg kind "$kind" '(.kinds | index($kind)) != null' "$MANIFEST" >/dev/null 2>&1 || continue
107+
jq -e --arg ep "$entry_point" '.entryPoints | has($ep)' "$MANIFEST" >/dev/null 2>&1 \
108+
|| fail "kind '$kind' requires an 'entryPoints.$entry_point' to load"
109+
done
110+
78111
# Refuse any symlink anywhere inside the plugin folder. Symlinks could point a
79112
# copied plugin back at arbitrary files on disk after it lands in the trusted
80113
# plugins directory. The .git dir is skipped: installed plugins are git

‎default/omarchy/omarchy-menu.jsonc‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@
154154
"setup.config.hyprland": {"icon":"","label":"Hyprland","action":"omarchy-launch-config-editor \"$HOME/.config/hypr/hyprland.lua\""},
155155
"setup.config.hyprsunset": {"icon":"","label":"Hyprsunset","action":"omarchy-launch-config-editor ~/.config/hypr/hyprsunset.conf && omarchy-restart-hyprsunset"},
156156
"setup.config.xcompose": {"icon":"󰞅","label":"XCompose","action":"omarchy-launch-config-editor ~/.XCompose && omarchy-restart-xcompose"},
157+
"setup.plugin": {"icon":"󰐱","label":"Plugins","aliases":["plugin","plugins"]},
158+
"setup.plugin.enable": {"icon":"󰄬","label":"Enable Plugin","action":"omarchy-menu-plugin enable"},
159+
"setup.plugin.disable": {"icon":"󰅖","label":"Disable Plugin","action":"omarchy-menu-plugin disable"},
160+
"setup.plugin.add": {"icon":"󰖟","label":"Add Plugin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-plugin add'"},
161+
// Only a plugin you installed yourself can be deleted, so Remove stays
162+
// hidden until there is one.
163+
"setup.plugin.remove": {"icon":"󰭌","label":"Remove Plugin","when":"compgen -G \"$HOME/.config/omarchy/plugins/*/manifest.json\"","action":"omarchy-menu-plugin remove"},
157164

158165
// Install
159166
"install.package": {"icon":"󰣇","label":"Package","action":"xdg-terminal-exec --app-id=org.omarchy.terminal omarchy-pkg-install"},

‎docs/omarchy-shell.md‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,19 @@ omarchy plugin update --all # fetches, shows a diff, fast-forwards
5252
omarchy plugin remove acme.weather
5353
```
5454

55+
**Setup › Plugins** offers Enable, Disable, Add, and Remove. Enable and Disable
56+
include built-ins as well as installed plugins. Remove is limited to installed
57+
plugins, since a built-in has no checkout to delete. Add and Remove open a
58+
terminal so their warning, confirmation, and output stay visible.
59+
60+
For a bar widget, on and off means its place in the bar. Everything else is
61+
loaded by default when it is built in, so `shell.json` records only the
62+
deviation: a third-party plugin you added under `plugins[]`, a built-in you
63+
switched off under `disabledPlugins[]`. A full bar has no off state: enabling
64+
one replaces the active bar, and it is therefore never offered under Disable.
65+
Bar widgets may set `barWidget.defaultSection` to `left`, `center`, or `right`;
66+
widgets that omit it default to `center`.
67+
5568
Plugins run as **unsandboxed code** inside `omarchy-shell`. Adding warns you
5669
before cloning, plugins land disabled so you can review the code before
5770
`omarchy plugin enable`, and updates show a diff before touching anything.
@@ -60,8 +73,9 @@ arguments — add `--yes` to skip every prompt (the path for scripts and agents)
6073

6174
You can still install by hand: drop a plugin into
6275
`~/.config/omarchy/plugins/<id>/`, run `omarchy plugin rescan`, then
63-
`omarchy plugin enable <id>` (bar widgets also need `omarchy bar plugin add <id>`;
64-
full bar replacements are selected with `omarchy bar use <id>`).
76+
`omarchy plugin enable <id>`. A bar widget starts in its declared default
77+
section and can be moved with `omarchy bar plugin move`; enabling a full bar
78+
replaces the one in use.
6579
The lower-level IPC methods remain available through `omarchy-shell shell ...`.
6680

6781
## IPC

0 commit comments

Comments
 (0)