diff --git a/bin/blob-branding-about b/bin/blob-branding-about index 29b987b..87214c7 100755 --- a/bin/blob-branding-about +++ b/bin/blob-branding-about @@ -19,7 +19,7 @@ text) blob-launch-editor ~/.config/blob/branding/about.txt >/dev/null 2>&1 && blob-launch-about >/dev/null 2>&1 ;; reset) - cp "$BLOB_PATH/icon.txt" ~/.config/blob/branding/about.txt && blob-launch-about >/dev/null 2>&1 + cp "$BLOB_PATH/branding/about.txt" ~/.config/blob/branding/about.txt && blob-launch-about >/dev/null 2>&1 ;; *) echo "Usage: blob-branding-about " >&2 diff --git a/bin/blob-branding-screensaver b/bin/blob-branding-screensaver index 3e126cc..af6b1d8 100755 --- a/bin/blob-branding-screensaver +++ b/bin/blob-branding-screensaver @@ -19,7 +19,7 @@ text) blob-launch-editor ~/.config/blob/branding/screensaver.txt >/dev/null 2>&1 && blob-launch-screensaver force >/dev/null 2>&1 ;; reset) - cp "$BLOB_PATH/logo.txt" ~/.config/blob/branding/screensaver.txt && blob-launch-screensaver force >/dev/null 2>&1 + cp "$BLOB_PATH/branding/screensaver.txt" ~/.config/blob/branding/screensaver.txt && blob-launch-screensaver force >/dev/null 2>&1 ;; *) echo "Usage: blob-branding-screensaver " >&2 diff --git a/bin/blob-show-logo b/bin/blob-show-logo index 466a39e..4034cea 100755 --- a/bin/blob-show-logo +++ b/bin/blob-show-logo @@ -2,8 +2,16 @@ # blob:summary=Display the Blob logo in the terminal using green color. +user_logo_file="$HOME/.config/blob/branding/screensaver.txt" +shipped_logo_file="$BLOB_PATH/branding/screensaver.txt" + +logo_file="$user_logo_file" +[[ -s $logo_file ]] || logo_file="$shipped_logo_file" + clear -echo -e "\033[32m" -cat <$BLOB_PATH/logo.txt -echo -e "\033[0m" +if [[ -s $logo_file ]]; then + echo -e "\033[32m" + cat <"$logo_file" + echo -e "\033[0m" +fi echo diff --git a/bin/blob-update b/bin/blob-update index 5ea4cb9..f068789 100755 --- a/bin/blob-update +++ b/bin/blob-update @@ -49,12 +49,9 @@ line_count() { } show_header() { - if has_gum; then - gum style --border rounded --border-foreground "$accent_color" --padding "0 2" --margin "1 0" \ - --bold "Blob Update" "$(date '+%A %-d %B, %H:%M')" - else - printf '\nBlob Update - %s\n\n' "$(date '+%A %-d %B, %H:%M')" - fi + blob-show-logo + styled "$accent_color" --bold "Blob Update" + styled "$muted_color" "$(date '+%A %-d %B, %H:%M')" } begin_step() { @@ -187,6 +184,19 @@ show_summary() { fi } +offer_reboot() { + [[ $reboot_needed == true && $confirm == true ]] || return 0 + echo + if has_gum; then + gum confirm "The kernel was updated. Reboot now?" || return 0 + else + local answer + read -rp "The kernel was updated. Reboot now? [y/N] " answer + [[ $answer == [yY] ]] || return 0 + fi + blob-system-reboot +} + show_header gather_pending @@ -235,3 +245,4 @@ notify_body="System and AUR packages are up to date" blob-notify-send "Update complete" "$notify_body" blob-hook post-update +offer_reboot diff --git a/docs/packages.md b/docs/packages.md index 7a2cb9a..aae7d1a 100644 --- a/docs/packages.md +++ b/docs/packages.md @@ -194,12 +194,14 @@ on it: blob update ``` -Checks for updates first and lists every pending system and AUR package with +Opens with the logo from `~/.config/blob/branding/screensaver.txt` (falling back +to `branding/screensaver.txt`), the same text the screensaver draws, so +`blob branding screensaver` changes both. It checks for updates first and lists every pending system and AUR package with its old and new version, then asks once with `gum confirm` (`--no-confirm` skips it). When nothing is pending it says so and stops. The update itself runs as four numbered steps: refresh the keyring, `pacman -Syu`, `yay -Sua` when the AUR is reachable, and prune orphans. It ends with a summary of what changed and -how long it took, a reminder to reboot when a new kernel came in, and a +how long it took, an offer to reboot when a new kernel came in, and a notification. A failed step is named on screen and in a critical notification. `blob update-available` prints the pending count that the bar's update indicator reads. The indicator rechecks every six hours and a few seconds after any pacman transaction, so it