Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Cleanup and small app updates #42

Merged
merged 2 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 1 addition & 3 deletions apps.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,14 @@ rocket = "cask" # Emoji picker optimised for blind people
the-unarchiver = "cask" # Unpacks archive files
transmission = "cask" # Open-source BitTorrent client
937984704 = "mas" # Amphetamine: Powerful keep-awake utility
1355679052 = "mas" # Dropover - Easier Drag & Drop: Speed up your workflow
1503446680 = "mas" # Clipboard Manager - PastePal: Copy Paste Keyboard History

[utilities]
chromedriver = "cask" # Automated testing of webapps for Google Chrome
qlmarkdown = "cask" # Quick Look generator for Markdown files
qlstephen = "cask" # Quick Look plugin for plaintext files without an extension
qlvideo = "cask" # Thumbnails, static previews, cover art and metadata for video files
quicklook-json = "cask" # Quick Look plugin for JSON files
syntax-highlight = "cask" # Quicklook extension for source files
webpquicklook = "cask" # Quick Look plugin for webp files

[shell-tools]
Expand Down Expand Up @@ -131,7 +130,6 @@ wget = "formula" # Internet file retriever
yq = "formula" # Process YAML, JSON, XML, CSV and properties documents from the CLI
yt-dlp = "formula" # Feature-rich command-line audio/video downloader
# Fun stuff
cowsay = "formula" # Configurable talking characters in ASCII art
lolcat = "formula" # Rainbows and unicorns in your console!
# Newer versions of system binaries
bash = "formula" # Bourne-Again SHell, a UNIX command interpreter
Expand Down
22 changes: 13 additions & 9 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ source "$(dirname "$0")/bash_traceback.sh"

echo -e "📲 \033[1;36mInstalling apps and packages...\033[0m"

# Ensure yq is installed to parse the apps.toml file
if ! command -v yq &> /dev/null; then
martimlobao marked this conversation as resolved.
Show resolved Hide resolved
brew install yq
fi

# Initialize arrays to store installed apps
installed_casks=()
installed_formulas=()
Expand Down Expand Up @@ -135,7 +140,7 @@ uv_sync() {
echo -e "❗️ \033[1;31mThe following uv-installed apps are missing from apps.toml:\033[0m"
# shellcheck disable=SC2001
echo "$missing_uv_apps" | sed 's/^/ /'
read -rp $'❓ \e[1;31mDo you want to uninstall these apps? (y/n \e[0m ' choice
read -rp $'❓ \e[1;31mDo you want to uninstall these apps? (y/n)\e[0m ' choice
if [[ "$choice" == "y" ]]; then
for app in $missing_uv_apps; do
uv tool uninstall "$app"
Expand Down Expand Up @@ -189,11 +194,6 @@ mas_sync() {
fi
}

# Ensure yq is installed
if ! command -v yq &> /dev/null; then
brew install yq
fi

# Populate the arrays with installed apps
populate_installed_apps

Expand Down Expand Up @@ -222,9 +222,13 @@ echo -e "\n🔼 \033[1;35mUpdating existing apps and packages...\033[0m"
brew update
brew upgrade
uv tool upgrade --all
read -rp $'❓ \e[1;31mUpdate Mac App Store apps (may be slightly buggy)? (y/n)\e[0m ' choice
if [[ "$choice" == "y" ]]; then
mas upgrade
if mas outdated | grep -q .; then
echo -e "❗️ \033[1;31mThe following Mac App Store apps are outdated:\033[0m"
mas outdated
read -rp $'❓ \e[1;31mUpdate Mac App Store apps (may be slightly buggy)? (y/n)\e[0m ' choice
if [[ "$choice" == "y" ]]; then
mas upgrade
fi
fi

# Remove outdated versions from the cellar
Expand Down
6 changes: 3 additions & 3 deletions local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ fi
# iStat Menus
if [[ -z "$(defaults read com.bjango.istatmenus license6 2>/dev/null || echo '')" ]]; then
echo -e "📝 \033[1;34mRegistering iStat Menus...\033[0m"
defaults write com.bjango.istatmenus _modelid -string "$(sysctl hw.model | sed 's/hw.model: //')"
defaults write com.bjango.istatmenus installDateV6 -int "$(date -v +14d +%s)"

ISTAT_EMAIL=$(op read "op://Private/iStat Menus 6/registered email")
ISTAT_KEY=$(op read "op://Private/iStat Menus 6/license key")

defaults write com.bjango.istatmenus _modelid -string "$(sysctl hw.model | sed 's/hw.model: //')"
defaults write com.bjango.istatmenus installDateV6 -int "$(date -v +14d +%s)"
/usr/libexec/PlistBuddy -c "Add :license6 dict" ~/Library/Preferences/com.bjango.istatmenus.plist
/usr/libexec/PlistBuddy -c "Add :license6:email string $ISTAT_EMAIL" ~/Library/Preferences/com.bjango.istatmenus.plist
/usr/libexec/PlistBuddy -c "Add :license6:serial string $ISTAT_KEY" ~/Library/Preferences/com.bjango.istatmenus.plist
Expand Down
4 changes: 4 additions & 0 deletions mackup/.config/starship.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ add_newline = true

[directory]
truncation_length = 5
truncation_symbol = "…/"
truncate_to_repo = false

[git_branch]
Expand All @@ -18,6 +19,9 @@ symbol = "☕️"
style_user = "bold dimmed blue"
show_always = false

[sudo]
disabled = false

# Disable these modules, they're noisy
[aws]
disabled = true
Expand Down
3 changes: 3 additions & 0 deletions mackup/.gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
# Generate a default gitgnore file (e.g. `git ignore ruby c > .gitignore`).
# Defaults to Python, macOS, Pants, and Visual Studio Code.
ignore = "!gi() { curl -sL https://www.toptal.com/developers/gitignore/api/${@:-macos,visualstudiocode,python,pants} ;}; gi"
# Delete all squashed branches.
# https://github.com/not-an-aardvark/git-delete-squashed#sh
delete-squashed = "!f() { local targetBranch=${1:-main} && git checkout -q $targetBranch && git branch --merged | grep -v \"\\*\" | xargs -n 1 git branch -d && git for-each-ref refs/heads/ \"--format=%(refname:short)\" | while read branch; do mergeBase=$(git merge-base $targetBranch $branch) && [[ $(git cherry $targetBranch $(git commit-tree $(git rev-parse $branch^{tree}) -p $mergeBase -m _)) == \"-\"* ]] && git branch -D $branch; done; }; f"

[pager]
stash = false
Loading