Consolidate dev -> omarchy-shell migration; drop premature widget removal
Replace the mako-only migration with a single "complete the flip"
migration that handles everything needed to bring a dev-channel user
onto omarchy-shell:
- install quickshell if it isn't already on the box
- stop and uninstall mako; pacman -Rns deletes the .service unit too,
so D-Bus activation can't conjure it back into existence
- stop and uninstall waybar with the same uninstall-not-mask approach
- move ~/.config/{mako,waybar} aside (timestamped backup) rather than
rm -rf, so anyone with hand-tuned rules can mine them
- clear the stale toggle-state markers
- call omarchy-restart-shell so the bar and notification daemon come
up mid-session without a relog
Drop migrations/1778715864.sh: shell.json hasn't shipped to any user
yet, so a migration removing widgets nobody has is dead code.
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
echo "Remove standalone night light, brightness, power profile, and power menu bar widgets (moved into quick settings or removed)"
|
||||
|
||||
config="$HOME/.config/omarchy/shell.json"
|
||||
[[ -f $config ]] || return 0
|
||||
|
||||
if ! grep -Eq '"id": *"(nightLight|brightness|powerProfile|powerMenu)"' "$config"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if omarchy-cmd-missing jq; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
tmp=$(mktemp)
|
||||
if jq '
|
||||
def keep_widget: select(.id != "nightLight" and .id != "brightness" and .id != "powerProfile" and .id != "powerMenu");
|
||||
.bar.layout.left |= map(keep_widget) |
|
||||
.bar.layout.center |= map(keep_widget) |
|
||||
.bar.layout.right |= map(keep_widget)
|
||||
' "$config" > "$tmp" 2>/dev/null && [[ -s $tmp ]]; then
|
||||
mv "$tmp" "$config"
|
||||
else
|
||||
rm -f "$tmp"
|
||||
fi
|
||||
+43
-18
@@ -1,27 +1,52 @@
|
||||
echo "Replace mako with the omarchy-shell notification plugin"
|
||||
echo "Flip from waybar + mako to omarchy-shell (quickshell-backed bar and notifications)"
|
||||
|
||||
# Stop any running instance so the new daemon can take the bus name. The
|
||||
# unit is Type=dbus / BusName=org.freedesktop.Notifications, so until mako
|
||||
# releases the name our quickshell server can't register.
|
||||
# ---------------------------------------------------------------- packages
|
||||
# Ensure quickshell is installed so omarchy-shell can launch. omarchy-pkg-add
|
||||
# is a no-op if already present.
|
||||
if omarchy-cmd-missing quickshell; then
|
||||
omarchy-pkg-add quickshell || true
|
||||
fi
|
||||
|
||||
# ---------------------------------------------------------------- mako -> shell
|
||||
# mako is replaced by the omarchy-shell notification plugin. Stop the running
|
||||
# instance, then uninstall outright — pacman -Rns removes the .service unit
|
||||
# file too, so D-Bus activation has nothing to look up afterwards.
|
||||
pkill -x mako 2>/dev/null || true
|
||||
systemctl --user stop mako.service 2>/dev/null || true
|
||||
|
||||
# Uninstall the package outright. This also deletes
|
||||
# /usr/lib/systemd/user/mako.service — D-Bus activation has nothing to
|
||||
# look up once the unit file is gone, so notify-send can never respawn it.
|
||||
# (`disable` isn't useful here: it only affects boot-time activation, not
|
||||
# the on-demand D-Bus path that's how mako actually starts.)
|
||||
if pacman -Qq mako >/dev/null 2>&1; then
|
||||
systemctl --user stop mako.service 2>/dev/null || true
|
||||
systemctl --user disable mako.service 2>/dev/null || true
|
||||
if omarchy-pkg-present mako; then
|
||||
sudo pacman -Rns --noconfirm mako >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
# Old user config dir is no longer read.
|
||||
[[ -d ~/.config/mako ]] && rm -rf ~/.config/mako
|
||||
# Move the old mako config aside instead of removing it. Users may have
|
||||
# hand-tuned rules they want to copy forward into the new notification
|
||||
# daemon's per-theme override file.
|
||||
if [[ -d ~/.config/mako ]]; then
|
||||
mv ~/.config/mako "$HOME/.config/mako.omarchy-shell.bak.$(date +%s)"
|
||||
fi
|
||||
|
||||
# Old toggle file is no longer read.
|
||||
# Old toggle marker is no longer read.
|
||||
[[ -f ~/.local/state/omarchy/toggles/mako.ini ]] && rm -f ~/.local/state/omarchy/toggles/mako.ini
|
||||
|
||||
# Reload the shell so the new NotificationServer claims the bus name.
|
||||
if command -v omarchy-restart-quickshell >/dev/null 2>&1; then
|
||||
omarchy-restart-quickshell >/dev/null 2>&1 || true
|
||||
# ---------------------------------------------------------------- waybar -> shell
|
||||
# waybar is replaced by the omarchy-shell bar plugin. Stop the process, then
|
||||
# uninstall; user config is stashed below in case they want to mine it.
|
||||
pkill -x waybar 2>/dev/null || true
|
||||
if omarchy-pkg-present waybar; then
|
||||
sudo pacman -Rns --noconfirm waybar >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
if [[ -d ~/.config/waybar ]]; then
|
||||
mv ~/.config/waybar "$HOME/.config/waybar.omarchy-shell.bak.$(date +%s)"
|
||||
fi
|
||||
|
||||
# Old toggle marker is no longer meaningful — autostart no longer reads it.
|
||||
[[ -f ~/.local/state/omarchy/toggles/waybar-off ]] && rm -f ~/.local/state/omarchy/toggles/waybar-off
|
||||
|
||||
# ---------------------------------------------------------------- launch shell
|
||||
# Hyprland's autostart calls omarchy-restart-shell at session start, but the
|
||||
# migration also runs mid-session on `omarchy update`. Kick the shell now so
|
||||
# the notification daemon and bar are live without waiting for a relog.
|
||||
if omarchy-cmd-present omarchy-restart-shell; then
|
||||
omarchy-restart-shell >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user