From 20a09cad86c161f7cd14cb8ea246167bb32611c9 Mon Sep 17 00:00:00 2001 From: Ryan Hughes <1630358+ryanrhughes@users.noreply.github.com> Date: Sat, 5 Jul 2025 16:41:38 -0400 Subject: [PATCH] Add shutdown sync script --- bin/omarchy-plymouth-shutdown-sync | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 bin/omarchy-plymouth-shutdown-sync diff --git a/bin/omarchy-plymouth-shutdown-sync b/bin/omarchy-plymouth-shutdown-sync new file mode 100755 index 0000000..a2b3f6b --- /dev/null +++ b/bin/omarchy-plymouth-shutdown-sync @@ -0,0 +1,28 @@ +#!/bin/bash +USER_HOME=$(find /home/* -maxdepth 0 | head -n1 | head -n1) + +echo "Running plymouth sync check for user dir: $USER_HOME" + +SYNC_FLAG="$USER_HOME/.config/omarchy/.plymouth-sync-needed" +CURRENT_THEME_LINK="$USER_HOME/.config/omarchy/current/theme" + +if [[ -f "$SYNC_FLAG" && -L "$CURRENT_THEME_LINK" ]]; then + CURRENT_THEME=$(readlink "$CURRENT_THEME_LINK") + THEME_NAME=$(basename "$CURRENT_THEME") + PLYMOUTH_DIR="$CURRENT_THEME/plymouth" + + if [[ -d "$PLYMOUTH_DIR" ]]; then + # Copy theme files to Plymouth + sudo cp -r "$CURRENT_THEME/plymouth/"* /usr/share/plymouth/themes/omarchy/ + + # Update Plymouth theme and rebuild + sudo plymouth-set-default-theme -R omarchy + + echo "Plymouth theme was found in $PLYMOUTH_DIR. Theme synced to $THEME_NAME." + else + echo "No plymouth directory found in $CURRENT_THEME. Skipping copy and rebuild." + fi + + # Remove sync flag + rm "$SYNC_FLAG" +fi