App To Brew Script rewrite
This commit is contained in:
3
BrewFile
3
BrewFile
@@ -16,8 +16,6 @@ brew "wget"
|
||||
cask "anydesk"
|
||||
# Reclaim tens of gigabytes of your storage used for various Xcode caches
|
||||
cask "devcleaner"
|
||||
# Utilities designed to make common development tasks easier
|
||||
cask "devtoys"
|
||||
# Matrix collaboration client
|
||||
cask "element"
|
||||
# Web browser
|
||||
@@ -93,5 +91,4 @@ vscode "streetsidesoftware.code-spell-checker-portuguese"
|
||||
vscode "vadimcn.vscode-lldb"
|
||||
vscode "visualstudioexptteam.intellicode-api-usage-examples"
|
||||
vscode "visualstudioexptteam.vscodeintellicode"
|
||||
vscode "vscodevim.vim"
|
||||
vscode "wix.vscode-import-cost"
|
||||
|
||||
@@ -136,8 +136,8 @@ defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
|
||||
# defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior -int 1
|
||||
# defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true
|
||||
|
||||
# Disable “natural” (Lion-style) scrolling
|
||||
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
|
||||
# Enable “natural” (Lion-style) scrolling
|
||||
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool true
|
||||
|
||||
# Increase sound quality for Bluetooth headphones/headsets
|
||||
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
|
||||
|
||||
0
scripts/brewBundle.sh
Normal file → Executable file
0
scripts/brewBundle.sh
Normal file → Executable file
@@ -1,22 +1,58 @@
|
||||
#!/bin/bash
|
||||
#!/bin/zsh
|
||||
|
||||
RED="\e[31m"
|
||||
GREEN="\e[32m"
|
||||
GRAY="\e[90m"
|
||||
BOLD="\e[1m"
|
||||
ENDCOLOR="\e[0m"
|
||||
|
||||
# List all installed apps
|
||||
all_apps=(/Applications/*)
|
||||
homebrew_apps=$(brew list --casks)
|
||||
not_found_list=()
|
||||
brew_available=()
|
||||
|
||||
# Loop through each app
|
||||
for app in "${all_apps[@]}"; do
|
||||
# Extract the app name without the extension (if any)
|
||||
app_name="${app##*/}"
|
||||
app_name="${app_name%.*}" # Removes everything after the last dot
|
||||
# Extract the name of the app without the path
|
||||
app_name=$(basename "$app")
|
||||
app_name="${app_name%.*}"
|
||||
app_name=$(echo "$app_name" | tr '[:upper:]' '[:lower:]')
|
||||
app_name=$(echo "$app_name" | tr " " -)
|
||||
|
||||
# Check if the app name exists in a brew cask
|
||||
brew search $app_name &> /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Found $app_name in Homebrew. Installing..."
|
||||
brew install --cask --force "$app_name"
|
||||
if [[ $app_name == "utilities" ]]; then continue; fi
|
||||
|
||||
echo -ne "${GRAY}Checking app: ${ENDCOLOR}${BOLD}$app_name${ENDCOLOR}${GRAY}...${ENDCOLOR}"
|
||||
# Check if app is in homebrew list, if not print its name to terminal
|
||||
echo $homebrew_apps | grep -wq $app_name
|
||||
if [[ $? == 0 ]]; then
|
||||
echo -e " ${GREEN}TRUE${ENDCOLOR}"
|
||||
else
|
||||
echo "$app_name not found in Homebrew."
|
||||
echo -e " ${RED}FALSE${ENDCOLOR}"
|
||||
not_found_list+=($app_name)
|
||||
|
||||
# Check if app is available with brew
|
||||
brew search --cask -q $app_name &>/dev/null | grep -x $app_name &>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
brew_available+=($app_name)
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "All checks completed."
|
||||
echo
|
||||
echo "-------------------------------------"
|
||||
echo
|
||||
echo -e "${BOLD}Not installed with brew: ${ENDCOLOR}$not_found_list"
|
||||
echo
|
||||
echo -e "${BOLD}Available in brew: ${ENDCOLOR}$brew_available"
|
||||
echo
|
||||
if [[ ! -z $brew_available ]]; then
|
||||
echo "-------------------------------------"
|
||||
echo
|
||||
echo -n "Replace the existing (available) apps with brew casks? (y/n): "
|
||||
read replaceApps
|
||||
if [[ $replaceApps == "y" ]]; then
|
||||
for app in "${brew_available[@]}"; do
|
||||
brew install --cask --force $app
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
0
scripts/symlink-files.sh
Normal file → Executable file
0
scripts/symlink-files.sh
Normal file → Executable file
Reference in New Issue
Block a user