diff --git a/mac-autohide-dock.sh b/mac-autohide-dock.sh new file mode 100644 index 0000000..7693ee2 --- /dev/null +++ b/mac-autohide-dock.sh @@ -0,0 +1,3 @@ +defaults write com.apple.Dock autohide-delay -float 0 + +defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES diff --git a/mac-brew-default-apps.sh b/mac-brew-default-apps.sh new file mode 100644 index 0000000..ef6392c --- /dev/null +++ b/mac-brew-default-apps.sh @@ -0,0 +1,30 @@ +echo "=== Install formulaes and casks, enter [y] for Yes, [anything else] for No:" +echo + +formulaeList=(jq openssl pandoc speedtest-cli yt-dlp) +for APP in "${formulaeList[@]}" +do + echo "--- brew install $APP" + read -p ">>> " YN + if [ "$YN" = 'y' ] + then + brew install $APP + fi + echo + echo "*************************************************" + echo +done + +caskList=(appcleaner avidemux baidunetdisk cloudflare-warp cursor douyin drawio emacs futubull iina iterm2 lx-music miniconda obs poe qq seafile-client shotcut spacelauncher sqlitestudio telegram-desktop telegram-lite termius thunder warp wechat) +for APP in "${caskList[@]}" +do + echo "--- brew install $APP" + read -p ">>> " YN + if [ "$YN" = 'y' ] + then + brew install $APP + fi + echo + echo "*************************************************" + echo +done diff --git a/mac-homebrew-install.sh b/mac-brew-install.sh similarity index 97% rename from mac-homebrew-install.sh rename to mac-brew-install.sh index feeea71..615be5c 100644 --- a/mac-homebrew-install.sh +++ b/mac-brew-install.sh @@ -20,3 +20,5 @@ echo "Installing Homebrew on MacOS" # uninstall: https://github.com/homebrew/install#uninstall-homebrew # /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" + +# update brew itself: brew update \ No newline at end of file diff --git a/mac-homebrew-mirror.sh b/mac-brew-mirror.sh similarity index 100% rename from mac-homebrew-mirror.sh rename to mac-brew-mirror.sh diff --git a/mac-config.sh b/mac-config.sh deleted file mode 100755 index dcd8832..0000000 --- a/mac-config.sh +++ /dev/null @@ -1,15 +0,0 @@ -defaults write com.apple.dock springboard-rows -int 9 - -defaults write com.apple.dock springboard-columns -int 15 - -defaults write com.apple.dock ResetLaunchPad -bool true - -defaults write com.apple.Dock autohide-delay -float 0 - -defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES - -# Don't create .DS_Store files -defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE -# To enable: defaults delete com.apple.desktopservices DSDontWriteNetworkStores - -killall Dock diff --git a/mac-disable-store-files.sh b/mac-disable-store-files.sh new file mode 100644 index 0000000..1a1392d --- /dev/null +++ b/mac-disable-store-files.sh @@ -0,0 +1,3 @@ +# Don't create .DS_Store files +defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE +# To enable: defaults delete com.apple.desktopservices DSDontWriteNetworkStores diff --git a/mac-homebrew-setup.sh b/mac-homebrew-setup.sh deleted file mode 100644 index bdfbb84..0000000 --- a/mac-homebrew-setup.sh +++ /dev/null @@ -1,24 +0,0 @@ -echo "=== Install formulaes and casks, enter [y] for Yes, [anything else] for No:" -echo - -formulaeList=(jq openssl pandoc speedtest-cli sqlite yt-dlp) -for APP in "${formulaeList[@]}" -do - echo "--- brew install $APP" - read -p ">>> " YN - if [ "$YN" = 'y' ] - then - echo brew install $APP - fi -done - -caskList=(appcleaner avidemux baidunetdisk cloudflare-warp cursor douyin drawio emacs futubull iina lx-music miniconda obs poe qq seafile-client shotcut spacelauncher sqlitestudio telegram-desktop telegram-lite termius thunder warp wechat) -for APP in "${formulaeList[@]}" -do - echo "--- brew install $APP" - read -p ">>> " YN - if [ "$YN" = 'y' ] - then - echo brew install $APP - fi -done \ No newline at end of file diff --git a/mac-remove-launchpad-icons.sh b/mac-remove-launchpad-icons.sh new file mode 100644 index 0000000..e6d51b2 --- /dev/null +++ b/mac-remove-launchpad-icons.sh @@ -0,0 +1,7 @@ +echo 删除 LaunchPad 里残留的图标 + +# open /private/var/folders/ in Finder, search for 'launchpad', right-click & select 'Services -> New Terminal at Folder' to open it in terminal: + +cd /private/var/folders/ht/rgh2n38j5mvc08wkxhlb1wlw0000gn/0/com.apple.dock.launchpad/db + +sqlite3 db "delete from apps where title='要删除的图标的名称';" && killall Dock diff --git a/mac-resize-launchpad.sh b/mac-resize-launchpad.sh index fb66b5d..f5b2a27 100644 --- a/mac-resize-launchpad.sh +++ b/mac-resize-launchpad.sh @@ -1,16 +1,16 @@ -echo === Enter [row number] (7 for MBA, 9 for iMac) or [leave blank] for default to 9 +echo "=== Enter [row number] (7 for MBA, 9 for iMac) or [leave blank] for default to 9" read -p ">>> " ROWS if [ "$ROWS" = "" ] then - ROWS = 9 + ROWS=9 fi defaults write com.apple.dock springboard-rows -int $ROWS -echo === Enter [column number] (10 for MBA, 15 for iMac) or [leave blank] for default to 15 +echo "=== Enter [column number] (10 for MBA, 15 for iMac) or [leave blank] for default to 15" read -p ">>> " COLS if [ "$COLS" = "" ] then - COLS = 15 + COLS=15 fi defaults write com.apple.dock springboard-columns -int $COLS diff --git a/nodejs-remove.sh b/nodejs-remove.sh index 249082e..e554859 100644 --- a/nodejs-remove.sh +++ b/nodejs-remove.sh @@ -2,7 +2,7 @@ echo "Usage: this-script.sh [VERSION]" -rm -fr /usr/local/bin/node -rm -fr /usr/local/bin/npm -rm -fr /usr/local/lib/node_modules -rm -fr /usr/local/include/node \ No newline at end of file +sudo rm -fr /usr/local/bin/node +sudo rm -fr /usr/local/bin/npm +sudo rm -fr /usr/local/lib/node_modules +sudo rm -fr /usr/local/include/node \ No newline at end of file diff --git a/proxy.sh b/proxy.sh index 4d34cf0..d1c08e7 100755 --- a/proxy.sh +++ b/proxy.sh @@ -11,10 +11,14 @@ fi # function proxy() { if [ "$proxySwitch" == "s" ] || [ "$proxySwitch" == "1" ]; then - echo "=== Proxy server running on port number: " + echo "=== Proxy server running on [port number] or [leave blank] for default 7897" while [ ! "$PORT" ] do read -p ">>> " PORT + if [ ! "$PORT" ] + then + PORT=7897 + fi done export all_proxy=socks5://127.0.0.1:$PORT export http_proxy=socks5://127.0.0.1:$PORT @@ -30,7 +34,10 @@ fi fi # } -echo all_proxy="$all_proxy" +echo all_proxy=$all_proxy +echo http_proxy=$http_proxy +echo https_proxy=$https_proxy + # ip.gs, ip.sb, ipinfo.io curl ipinfo.io echo " "