From 2a2a77685cc5ece4af707aafaf2b64fd35d9a8ea Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 28 Jun 2025 11:46:28 -0700 Subject: [PATCH] Add migration system and fix bluetooth service + missing bat --- bin/omarchy-update | 18 ++++++++++++++++++ migrations/1751134568.sh | 8 ++++++++ migrations/1751135253.sh | 3 +++ 3 files changed, 29 insertions(+) create mode 100644 migrations/1751134568.sh create mode 100644 migrations/1751135253.sh diff --git a/bin/omarchy-update b/bin/omarchy-update index 2d6f929..da517c8 100755 --- a/bin/omarchy-update +++ b/bin/omarchy-update @@ -1,5 +1,23 @@ #!/bin/bash cd ~/.local/share/omarchy + +# Remember the version we're at before upgrading +last_updated_at=$(git log -1 --format=%cd --date=unix) + +# Get the latest git pull + +# Run any pending migrations +for file in migrations/*.sh; do + filename=$(basename "$file") + migrate_at="${filename%.sh}" + + if [ $migrate_at -gt $last_updated_at ]; then + echo "Running migration ($migrate_at)" + source $file + fi +done + +# Back to where we came from cd - diff --git a/migrations/1751134568.sh b/migrations/1751134568.sh new file mode 100644 index 0000000..f1ecd07 --- /dev/null +++ b/migrations/1751134568.sh @@ -0,0 +1,8 @@ +# Turn on bluetooth service so blueberry works out the box +if systemctl is-enabled --quiet bluetooth.service && systemctl is-active --quiet bluetooth.service; then + # Bluetooth is already enabled, nothing to change + : +else + echo "Let's turn on Bluetooth service so the controls work" + sudo systemctl enable --now bluetooth.service +fi diff --git a/migrations/1751135253.sh b/migrations/1751135253.sh new file mode 100644 index 0000000..b830627 --- /dev/null +++ b/migrations/1751135253.sh @@ -0,0 +1,3 @@ +# Add missing installation of bat +echo "Add missing installation of bat (used by the ff alias)" +yay -S --noconfirm --needed bat