From a2aff944f301826ccc28941196c093b4bbdeb7f7 Mon Sep 17 00:00:00 2001 From: Christian Baer Date: Thu, 21 May 2020 22:29:28 +0200 Subject: [PATCH] # Added the ability to install apps that are not avaliable in brew or AppStore Download and install zip, dmg, pkg or app --- init/mac.sh | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/init/mac.sh b/init/mac.sh index 856291a..35e0c1c 100755 --- a/init/mac.sh +++ b/init/mac.sh @@ -2,8 +2,18 @@ # Inspired by https://github.com/mathiasbynens/dotfiles/blob/master/.macos from Mathias Bynens MAC_HOSTNAME="leia" + +# URLs that should be created as singlesite browsers MAC_NATIVEFIERSITES="https://web.threema.ch/ https://app.youneedabudget.com/" + +# Options for nativefier MAC_NATIVEFIEROPTS="--darwin-dark-mode-support" + +# URLs of additional apps that should be downloaded as zip, dmg, pkg or app +MAC_INSTALLDOWNLOADS="https://dl.exactcode.de/tmp/3bb50ff8eeb7ad116724b56a820139fa/ExactScanPro-19.10.10.dmg https://downloads.skylum.com/luminar4/installer/mac/Luminar4Installer.zip" + +# tmp dirs +MAC_DOWNLOAD="/tmp/macinstall" MAC_NATIVEFIERTMP="/tmp/nativefier" # Close any open System Preferences panes, to prevent them from overriding @@ -175,8 +185,47 @@ echo ">>> Processing Brewfile..." # Install apps from Brewfile brew bundle -#TODO Install Luminar -#TODO Install exactscan pro + +echo ">>> Instaling apps that are not avaliable in brew or AppStore..." +MAC_INSTALLMOUNT="$MAC_DOWNLOAD/mount" +mkdir -p ${MAC_INSTALLMOUNT} + +cd $MAC_DOWNLOAD + +# Download all packages +for d in ${MAC_INSTALLDOWNLOADS}; do + echo ">>> Downloading ${d}" + curl -O ${d} +done + +# Extracting *.zip +find $MAC_DOWNLOAD -name "*.zip" -print0 | while IFS= read -r -d '' f; do + echo ">>> Extracting ${f}" + unzip -q ${f} + rm ${f} +done + +# Install *.pkg +find $MAC_DOWNLOAD -name "*.pkg" -print0 | while IFS= read -r -d '' f; do + echo ">>> Processing ${f}" + sudo installer -pkg "$f" -target / +done + +# Install *.dmg +find $MAC_DOWNLOAD -name "*.dmg" -print0 | while IFS= read -r -d '' f; do + echo ">>> Processing ${f}" + hdiutil attach $f -quiet -mountpoint ${MAC_INSTALLMOUNT} + cp -rf ${MAC_INSTALLMOUNT}/*.app /Applications + hdiutil detach ${MAC_INSTALLMOUNT} -quiet +done + +# Install *.app +find $MAC_DOWNLOAD -name "*.app" -print0 | while IFS= read -r -d '' f; do + echo ">>> Processing ${f}" + open -a "${f}" +done + +#rm -rf $MAC_DOWNLOAD echo ">>> Creating single site browsers"