Move Elsewhen into Omarchy as omarchy.elsewhen (#13429)
* Move Elsewhen into Omarchy as omarchy.elsewhen The world clock ships in the shell tree instead of its own package. A migration renames existing bar entries with their settings and removes the retired package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove Elsewhen's shelved Earth row, overlap band and sky tint Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Tidy Elsewhen's models, data helper and docs, and drop currency Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Restructure Elsewhen's panel and globe on the shared shell components Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Show Elsewhen's bar globe upright Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Use the shared city search for Elsewhen's globe jump bar Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep legacy Elsewhen entries single and retry offline geocodes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fetch Elsewhen's weather with curl instead of a Python helper Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5c7cef1e78
commit
e7218e36f2
37 files changed
+6780
-155
No files matched your search
@@ -1,23 +1,13 @@
|
||||
echo "Install Elsewhen, the world clock plugin"
|
||||
|
||||
omarchy-pkg-add elsewhen
|
||||
|
||||
packaged_plugin="/usr/share/omarchy/shell/plugins/omacom.elsewhen"
|
||||
user_plugin="$HOME/.config/omarchy/plugins/omacom.elsewhen"
|
||||
|
||||
# The package moved from plugins/ to shell/plugins/ once, stranding the link an
|
||||
# earlier run made to the old path. A link the user made is left alone.
|
||||
if [[ -L $user_plugin && ! -e $user_plugin && $(readlink "$user_plugin") == /usr/share/omarchy/* && -d $packaged_plugin ]]; then
|
||||
ln -sfn "$packaged_plugin" "$user_plugin"
|
||||
fi
|
||||
|
||||
# Dev checkouts do not contain plugins installed by system packages.
|
||||
if [[ ! $OMARCHY_PATH -ef /usr/share/omarchy && -d $packaged_plugin && ! -e $user_plugin && ! -L $user_plugin ]]; then
|
||||
mkdir -p "${user_plugin%/*}"
|
||||
ln -s "$packaged_plugin" "$user_plugin"
|
||||
fi
|
||||
echo "Put Elsewhen, the world clock, on the bar"
|
||||
|
||||
# Best-effort, like the put below: an update whose shell cannot be asked still
|
||||
# finishes, and restarts the shell once the migrations are through.
|
||||
omarchy-shell -q shell rescanPlugins
|
||||
omarchy-bar put omacom.elsewhen --before omarchy.clock
|
||||
|
||||
# A legacy omacom.elsewhen entry is renamed in place by a later migration.
|
||||
config_file="$HOME/.config/omarchy/shell.json"
|
||||
if [[ -s $config_file ]] && jq -e '[.bar.layout[]?[]? | if type == "object" then .id else . end] | index("omacom.elsewhen")' "$config_file" >/dev/null 2>&1; then
|
||||
echo "Elsewhen is already on the bar"
|
||||
else
|
||||
omarchy-bar put omarchy.elsewhen --before omarchy.clock
|
||||
fi
|
||||
@@ -0,0 +1,30 @@
|
||||
echo "Move Elsewhen, the world clock, into Omarchy as omarchy.elsewhen"
|
||||
|
||||
# The widget keeps its entry, and with it the cities and settings stored there.
|
||||
config_file="$HOME/.config/omarchy/shell.json"
|
||||
if [[ -s $config_file ]]; then
|
||||
tmp=$(mktemp)
|
||||
jq '
|
||||
def rename:
|
||||
if . == "omacom.elsewhen" then "omarchy.elsewhen"
|
||||
elif type == "object" and .id == "omacom.elsewhen" then .id = "omarchy.elsewhen"
|
||||
end;
|
||||
|
||||
if (.bar.layout | type) == "object" then .bar.layout |= map_values(if type == "array" then map(rename) end) end
|
||||
| if (.bar.centerAnchor | type) == "string" then .bar.centerAnchor |= rename end
|
||||
| if (.plugins | type) == "array" then .plugins |= map(rename) end
|
||||
| if (.disabledPlugins | type) == "array" then .disabledPlugins |= map(rename) end
|
||||
' "$config_file" >"$tmp"
|
||||
mv "$tmp" "$config_file"
|
||||
fi
|
||||
|
||||
# Dev checkouts found the packaged plugin through this link; one the user made
|
||||
# elsewhere is left alone.
|
||||
user_plugin="$HOME/.config/omarchy/plugins/omacom.elsewhen"
|
||||
if [[ -L $user_plugin && $(readlink "$user_plugin") == /usr/share/omarchy/* ]]; then
|
||||
rm "$user_plugin"
|
||||
fi
|
||||
|
||||
rm -rf "${XDG_CACHE_HOME:-$HOME/.cache}/omacom-elsewhen"
|
||||
|
||||
omarchy-pkg-drop elsewhen
|
||||
Reference in new issue
Block a user