Add migrations to omarchy-update and use the first one to turn on bluetooth

This commit is contained in:
David Heinemeier Hansson
2025-06-28 11:27:33 -07:00
parent 96e18af390
commit f1679ba142
2 changed files with 25 additions and 0 deletions

View File

@ -1,5 +1,23 @@
#!/bin/bash #!/bin/bash
cd ~/.local/share/omarchy 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 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 for $migrate_at"
source $file
fi
done
# Back to where we came from
cd - cd -

7
migrations/1751134568.sh Normal file
View File

@ -0,0 +1,7 @@
# 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