Something went wrong. Try again.
Dotfiles for my macos setup
Something went wrong. Try again.
707 B · 37 lines
at main
1234567891011121314151617181920212223242526272829303132333435363738#!/bin/bash# Interactive end-of-topgrade steps (cleanup, backup, trash, restart).
SOURCE_DIR=$(chezmoi source-path)
. "$SOURCE_DIR/scripts/utils"
empty_macos_trash() { osascript <<'APPLESCRIPT'try tell application "Finder" to empty trashon error number -128 -- User canceled. Not fatal.end tryAPPLESCRIPT}
ask_for_confirmation "Run Mole?"if answer_is_yes; then mo clean mo optimizefi
ask_for_confirmation "Run Restic backup?"if answer_is_yes; then restic-backupfi
ask_for_confirmation "Empty macOS Trash?"if answer_is_yes; then empty_macos_trashfi
ask_for_confirmation "Do you want to restart your computer?"if answer_is_yes; then sudo shutdown -r nowfi