Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions ludosavi/saves-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ say() { printf '\n==> %s\n' "$*"; }
warn() { printf '\n!!! %s\n' "$*" >&2; }

ensure_flatpak() {
local id="$1"
if flatpak list --app --columns=application 2>/dev/null | grep -qx "$id"; then
echo " [ok] $id already installed"
else
echo " [install] $id"
flatpak install -y --noninteractive flathub "$id"
fi
local id="$1"
if flatpak list --app --columns=application 2>/dev/null | grep -qx "$id"; then
echo " [ok] $id already installed"
else
echo " [install] $id"
flatpak install -y --noninteractive flathub "$id"
fi
}

# --- 1. Sanity: Heroic must be installed (we don't install it here) ---
if ! flatpak list --app --columns=application 2>/dev/null | grep -qx "$HEROIC_FLATPAK"; then
warn "Heroic flatpak ($HEROIC_FLATPAK) not found. Install Heroic first, then re-run."
exit 1
warn "Heroic flatpak ($HEROIC_FLATPAK) not found. Install Heroic first, then re-run."
exit 1
fi

# --- 2. Install Ludusavi (flatpak); Nextcloud client must already be installed ---
Expand All @@ -44,21 +44,21 @@ ensure_flatpak "$LUDUSAVI_FLATPAK"
say "Granting Heroic permission to use the Flatpak portal"
flatpak override --user --talk-name=org.freedesktop.Flatpak "$HEROIC_FLATPAK"

if dpkg -s nextcloud-desktop >/dev/null 2>&1; then
echo " [ok] nextcloud-desktop (apt) installed"
NEXTCLOUD_LAUNCH_HINT="nextcloud"
elif flatpak list --app --columns=application 2>/dev/null | grep -qx "$NEXTCLOUD_FLATPAK"; then
echo " [ok] $NEXTCLOUD_FLATPAK (flatpak) installed"
NEXTCLOUD_LAUNCH_HINT="flatpak run $NEXTCLOUD_FLATPAK"
else
warn "Nextcloud client not installed. Recommended: sudo apt install nextcloud-desktop"
warn " (apt version trusts host CAs directly; flatpak version fights with Qt cert paths)"
exit 1
fi
# if dpkg -s nextcloud-desktop >/dev/null 2>&1; then
# echo " [ok] nextcloud-desktop (apt) installed"
# NEXTCLOUD_LAUNCH_HINT="nextcloud"
# elif flatpak list --app --columns=application 2>/dev/null | grep -qx "$NEXTCLOUD_FLATPAK"; then
# echo " [ok] $NEXTCLOUD_FLATPAK (flatpak) installed"
# NEXTCLOUD_LAUNCH_HINT="flatpak run $NEXTCLOUD_FLATPAK"
# else
# warn "Nextcloud client not installed. Recommended: sudo apt install nextcloud-desktop"
# warn " (apt version trusts host CAs directly; flatpak version fights with Qt cert paths)"
# exit 1
# fi

# --- 3. Nextcloud client signed in? ---
if [ ! -d "$NEXTCLOUD_DIR" ]; then
cat <<EOF
cat <<EOF

==> Nextcloud client not yet configured on this machine.
Sign-in is GUI-only; finishing up requires three clicks:
Expand All @@ -69,7 +69,7 @@ if [ ! -d "$NEXTCLOUD_DIR" ]; then
4) Wait for first sync to settle, then re-run this script.

EOF
exit 0
exit 0
fi

# --- 4. Saves folder ---
Expand All @@ -96,8 +96,8 @@ say "Wrote Ludusavi config: $CONFIG_FILE"

# --- 6. Heroic pre/post hooks (managed by install.sh as symlinks) ---
if [ ! -x "$PRE_SCRIPT" ] || [ ! -x "$POST_SCRIPT" ]; then
warn "Heroic hook scripts not found at $SCRIPTS_DIR. Run install.sh first."
exit 1
warn "Heroic hook scripts not found at $SCRIPTS_DIR. Run install.sh first."
exit 1
fi
mkdir -p "$HOME/.local/state"
say "Heroic hooks present:"
Expand Down
Loading