Skip to content

Commit 65098d3

Browse files
Adds various macOS settings & Gaming App «Heroic»
macOS settings: Apple Messages & Music apps, fn-Key functionality, draggable windows, Trash bin auto-cleanup, Mouse acceleration.
1 parent 2759a68 commit 65098d3

File tree

10 files changed

+194
-47
lines changed

10 files changed

+194
-47
lines changed

Applications/Heroic.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env zsh
2+
3+
# Transmission.app
4+
function installAppHeroicGamesLauncher(){
5+
# --> App version to use
6+
local version="2.14.1"
7+
local platform="-arm64"
8+
# --> Set Download URL
9+
if checkIfAppleSilicion; then
10+
# ...for ARM-based Apple Silicon Macs
11+
local downloadUrl="https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/releases/download/v$version/Heroic-$version-macOS-arm64.dmg"
12+
else
13+
# ...for Intel-based Macs
14+
platform=""
15+
local downloadUrl="https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/releases/download/v$version/Heroic-$version-macOS-x64.dmg"
16+
fi
17+
# --> Download
18+
downloadFromUrl "downloadUrl" "Heroic.dmg"
19+
# --> Mount & copy
20+
# (Cannot use unmountFile() function due to Volume having a different name than the App)
21+
hdiutil attach "$downloadFolder/Heroic.dmg" -quiet
22+
cp -r "/Volumes/Heroic $version$platform/Heroic.app" "$downloadFolder"
23+
# --> Unmount & move
24+
hdiutil unmount "/Volumes/Heroic $version-$platform" -force -quiet
25+
moveApplication "Heroic.app"
26+
}
27+
export -f installAppHeroicGamesLauncher

README.md

Lines changed: 47 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,88 @@
11
Automate your macOS setup
22
===
33

4-
**Welcome to the macOS Scripted Setup!<br>This project helps Mac users quickly and easily set up a new computer or useraccount by automatically configuring a range of system settings and installing commonly used applications.**
4+
**Welcome to the macOS Scripted Setup.<br>This project helps Mac users quickly and easily set up a new computer or useraccount by automatically configuring a range of system settings and installing commonly used applications.**
5+
6+
> [!TIP]
7+
> The scripted setup was tested on Intel-based Macs & Apple Silicon Macs
8+
> On macOS 12 Monterey up to macOS 14 Sonoma
9+
510

611
## What is this?
712

13+
The macOS Scripted Setup is **perfect for users who want to save time and avoid the hassle of manually changing settings and installing apps**. The whole project, but particularly the configuration file, is **portable** - so you can keep them on a USB-stick for the next Mac setup. Give it a try and streamline your new Mac setup process!
14+
815
![Screenshot of macOS Scripted Setup in action](/README_demo.png?raw=true)
916

1017
The script is easy to use and can be run directly from the Terminal application, as a regular user or admin user. It automatically performs a series of commands to change default macOS settings and download applications. It's designed to be widely backward and forward compatible with various macOS versions.
1118

12-
**All settings can be configured!** Some features include enabling the firewall, setting better security features, customising the Finder, Dock, and Mission Control for better productivity; and many more. Additionally, the script installs applications such as browsers, media players, productivity apps, and web development tools.
19+
**All settings can be configured.** Some features include enabling the firewall, setting better security features, customising the Finder, Dock, and Mission Control for better productivity; and many more. Additionally, the script installs applications such as browsers, media players, productivity apps, and web development tools.
1320

14-
The macOS Scripted Setup is **perfect for users who want to save time and avoid the hassle of manually changing settings and installing apps**. The whole project, but particularly the configuration file, is **portable** - so you can keep them on a USB-stick for the next Mac setup. Give it a try and streamline your new Mac setup process!
21+
### What is being done exactly?
1522

16-
## How to use
23+
<details>
24+
<summary>See what features, settings, and applications can be changed / installed</summary>
25+
26+
### The script can change the following settings:
27+
28+
* FileVault, macOS Firewall, Mission Control, Control Centre, Finder, Dock, git, SSH Key, adds Userhome folders, Menu bar clock, Fast User Switching, and [more](https://github.com/Swiss-Mac-User/macOS-scripted-setup/tree/installer/Usersettings).
1729

18-
<sub>P.s.: the scripts were tested successfully on Apple Silicon Mac and macOS 13 Ventura.</sub>
30+
### …and is capable of installing these Apps:
31+
32+
Some Apps are downloaded from the official websites, other are added through Homebrew or its Mac App Store CLI extension.
33+
34+
* 1Password, AlDente, Beyond Compare, Boop, Brave, Composer, Discord, Docker, eqMac, Fig, Firefox, Fork, GasMask, Git, Google Chrome, Homebrew, Keka, LinearMouse, MAMP, Nova, Pixelmator Pro, Quick Look plugins, Rosetta 2, Safari extensions, Sequel Ace, SonarQube, Spotify, Steam, Strongbox, Telegram, Transmission, Tresorit, Warp, Xcode Command Line Tools, Xnapper, and [more](https://github.com/Swiss-Mac-User/macOS-scripted-setup/tree/installer/Applications).
35+
</details>
36+
37+
38+
## How to use
1939

2040
### 📥 Download macOS Scripted Setup
2141

22-
Fast and easy download with this command in the `Terminal.app`:
42+
Automatic download with this command in the `Terminal.app` from Applications » Utilities:
2343

2444
```bash
2545
curl -SL "https://github.com/Swiss-Mac-User/macOS-scripted-setup/archive/refs/heads/installer.zip" | tar xz -C "$HOME/Downloads" && open "$HOME/Downloads/macOS-scripted-setup-installer"
2646
```
2747

28-
Alternatively you can manually download & extract the latest «Source code (zip)» [from Releases](/../../releases) to your `~/Downloads/` folder.
48+
Alternatively you can manually download & extract the latest «Source code (zip)» [from Releases](/../../releases) to your `~/Downloads/` folder.
2949

3050
### ⚙️ Configure your preferences
3151

3252
1. Duplicate the file `config.default.sh` as `config.sh`
3353

34-
2. Open `config.sh` with TextEdit
54+
2. Open `config.sh` in a Text editor (e.g. `TextEdit.app`)
55+
56+
3. …and change all settings to your personal preferences, using `true`/`false`.
57+
58+
> [!WARNING]
59+
> If no `config.sh`-file is present, the setup will use the default configs from `config.default.sh`!</sup>
60+
61+
#### Advanced settings
62+
<details>
63+
<summary>Configuring custom bash commands to run</summary>
64+
65+
If you want to run additional bash commands as part of the setup, you can duplicate the template-file `mycommands.template.sh` as `mycommands.sh`, and populate it with any commands. These custom commands will be executed LAST in the whole setup (see the `run.sh` file).
66+
67+
</details>
3568

36-
3. …and change all settings to your personal preferences, using `true`/`false`.<br>(Note: if no `config.sh` is present, it will fall back to the default configs)
3769

3870
### 🚀 Start the scripted Setup
3971

40-
Maybe now is the time to go and get a coffee ☕️…
72+
Maybe now is the time to [grab a coffee ☕️](https://bmc.link/swissmacuser/)
4173

4274
1. Open the «Terminal.app» from Applications » Utilities
4375

44-
2. Paste the following command to the Terminal.app, and start the setup by pressing `Return`:
76+
2. Paste the following command to the Terminal.app:
4577

4678
```bash
4779
cd ~/Downloads/macOS-scripted-setup-installer/ && chmod +x ./run.sh && ./run.sh
4880
```
4981

50-
Watch the magic happen… and occasionally interact when instructions show up (e.g. sign-in on the Mac App Store-App).
82+
3. Now start the setup by pressing `Return` & watch the magic happen…
83+
84+
> [!TIP]
85+
> **Occasionally you have to interact** when instructions show up, such as to sign-in on the Mac App Store.
5186
5287
#### ✨ That's it - happy installation! :)
5388

@@ -61,23 +96,6 @@ Report an [Issue](/../../issues) or start a [new Discussion](/../../discussions)
6196
Feel free to [fork this project](/../../fork) and add Pull Requests for any suggested changes or additions!
6297

6398

64-
65-
## Advanced settings
66-
67-
If you want to run additional bash commands as part of the setup, you can duplicate the template-file `mycommands.template.sh` as `mycommands.sh`, and populate it with any commands. These custom commands will be executed LAST in the whole setup (see the `run.sh` file).
68-
69-
### What is being done?
70-
71-
The script changes the following settings:
72-
73-
* FileVault, macOS Firewall, Mission Control, Control Centre, Finder, Dock, git, SSH Key, adds Userhome folders, Menu bar clock, Fast User Switching, and more.
74-
75-
…and is capable of installing these Apps:
76-
77-
* Xcode Command Line Tools, Homebrew, Rosetta 2, Keka, Quick Look plugins, 1Password, Safari extensions, Beyond Compare, Discord, Fig, Firefox, Google Chrome, Pixelmator Pro, Spotify, Strongbox, Telegram, Transmission, Tresorit, Warp, Xnapper, Git, Boop, Composer, Docker, SonarQube, Fork, GasMask, MAMP, Nova, Sequel Ace, and others.
78-
79-
Some Apps are downloaded from the official websites, other are added through Homebrew or its Mac App Store CLI extension.
80-
8199
---
82100

83101
<p align="center"><a href="https://bmc.link/swissmacuser/">

Usersettings/Finder.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ function disableNaturalScrolling(){
5959
}
6060
export -f disableNaturalScrolling
6161

62+
# Interface: allow dragging windows anywhere using Command+Control+Click
63+
function enableFullWindowDragzone(){
64+
defaults write NSGlobalDomain "NSWindowShouldDragOnGesture" -bool TRUE
65+
}
66+
export -f enableFullWindowDragzone
67+
6268
# Interface, disable menu bar transparency
6369
function disableTransparencyAndTinting(){
6470
defaults write NSGlobalDomain "AppleEnableMenuBarTransparency" -bool FALSE
@@ -148,6 +154,12 @@ function disableEmptyTrashWarning(){
148154
}
149155
export -f disableEmptyTrashWarning
150156

157+
# Automatically remove items from the Trash after 30 days
158+
function enableTrashAutoremove30days(){
159+
defaults write com.apple.finder "FXRemoveOldTrashItems" -bool TRUE
160+
}
161+
export -f enableTrashAutoremove30days
162+
151163
# Add Folder settings (.DS_Store files)
152164
function updateApplicationsFolderListColumns(){
153165
if ! checkIfFileExists "$HOME/Applications/.DS_Store"; then

Usersettings/Keyboard.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env zsh
2+
3+
# Keyboard fn 🌐 key shows Emoji & Symbols popup. Supported values:
4+
# --> 0 = No function / do nothing (default)
5+
# --> 1 = Change keyboard input source
6+
# --> 2 = Show "Emoji & Symbols"
7+
# --> 3 = Start Dictation (press 2x)
8+
function useFnKeyFor(){
9+
local changeMode=false
10+
local configFnKeyFunction=$1
11+
case "$configFnKeyFunction" in
12+
off) changeMode=0;;
13+
language) changeMode=1;;
14+
emoji) changeMode=2;;
15+
dictation) changeMode=3;;
16+
*) changeMode=false;;
17+
esac
18+
19+
if [ "$changeMode" != false ]; then
20+
defaults write com.apple.HIToolbox "AppleFnUsageType" -int $changeMode
21+
fi
22+
}
23+
export -f useFnKeyFor

Usersettings/Messages.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env zsh
2+
3+
# Show the subject field in Messages (subjects are sent in bold format)
4+
# Source: https://gist.github.com/getaaron/a9dc64b6ea2fa8299af6b7077f4386ae
5+
function enableMessagesSubjectField(){
6+
defaults write com.apple.MobileSMS "MMSShowSubject" -bool TRUE
7+
}
8+
export -f enableMessagesSubjectField

Usersettings/Music.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env zsh
2+
3+
# Display «Playing next» Notification
4+
function showNextSongNotification(){
5+
defaults write com.apple.Music "userWantsPlaybackNotifications" -bool TRUE
6+
}
7+
export -f showNextSongNotification

Usersettings/Screenshots.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ export -f useNumericScreenshots
1111
# Supported file types: png (default), bmp, gif, heic, jpg, jp2, tif, pict, pdf, tga, tiff
1212
function saveScreenshotsAs(){
1313
local changeFormat=false
14-
case "$ScreenshotsImageFormat" in
14+
local configUseScreenshotsFormat="$1"
15+
case "$configUseScreenshotsFormat" in
1516
png) changeFormat=false;;
16-
bmp|gif|heic|jpg|jp2|tif|pict|pdf|tga|tiff) changeFormat="$ScreenshotsImageFormat";;
17+
bmp|gif|heic|jpg|jp2|tif|pict|pdf|tga|tiff) changeFormat="$configUseScreenshotsFormat";;
1718
*) changeFormat=false;;
1819
esac
1920

2021
# Screenshot format is valid and not default (png):
21-
if [ ! "$changeFormat" ]; then
22+
if [ "$changeFormat" != false ]; then
2223
defaults write com.apple.screencapture "type" -string "$changeFormat"
2324
fi
2425
}

Usersettings/Trackpad.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,21 @@ function enableTrackpadClicking(){
66
# Enable Single Tap to Click
77
defaults write com.apple.AppleMultitouchTrackpad "Clicking" -int 1
88
# Enable Right Click
9+
defaults write com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode -string 'TwoButton'
910
defaults write com.apple.AppleMultitouchTrackpad "TrackpadRightClick" -int 1
1011
}
1112
export -f enableTrackpadClicking
1213

1314
# --> Increase Mouse speed on Trackpads and Mouses
1415
function increaseMouseSpeed(){
15-
# -g = Setting is in .GlobalPreferences.plist
16-
defaults write -g com.apple.trackpad.scaling -int 2
17-
defaults write -g com.apple.mouse.scaling -float 1.5
16+
defaults write NSGlobalDomain com.apple.trackpad.scaling -int 2
17+
defaults write NSGlobalDomain com.apple.mouse.scaling -float 1.5
1818
}
1919
export -f increaseMouseSpeed
20+
21+
# --> Disable Mouse cursor acceleration
22+
function disableMouseAcceleration(){
23+
defaults write NSGlobalDomain com.apple.mouse.linear -bool YES
24+
25+
}
26+
export -f disableMouseAcceleration

config.default.sh

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ removeiMovie=false
7070
# -- 2.2 Required Applications --
7171
# (others have dependencies for these)
7272
installXcodeTools=false
73-
installHomebrew=false
73+
installHomebrew=true
7474
installAppStoreApps=true # <-- requires Homebrew=TRUE
7575
installRosetta=false
7676

@@ -81,15 +81,15 @@ installSyntaxHighlightQuickLook=true
8181
# -- 2.4 Install Applications --
8282
install1Password=false
8383
installAdGuardSafari=true
84-
installAlDente=true # <-- only supported on MacBooks (MBA, MBP)
84+
installAlDente=false # <-- only supported on MacBooks (MBA, MBP)
8585
installBeyondCompare=false
8686
installBraveBrowser=false
8787
installDiscord=false
8888
installEqMac=false
8989
installFigma=false
9090
installFirefox=false
9191
installGoogleChrome=false
92-
installGrandPerspective=true
92+
installGrandPerspective=false
9393
installLinearMouse=false
9494
installMacsFanControl=false
9595
installMicrosoftOffice=false
@@ -115,31 +115,41 @@ installBoop=false
115115
installComposer=false # <-- will also install PHP
116116
installDocker=false # <-- only installed when MAMP=FALSE
117117
useOrbStackOverDocker=false # <-- use OrbStack instead of Docker
118-
installSonarQube=false # <-- only installed when Docker=TRUE
119118
installFork=false
120119
installGasMask=false
121120
installMAMP=false
122121
installSequelAce=false
122+
installSonarQube=false # <-- only installed when Docker=TRUE
123123

124124
# -- 2.6 Mac Gaming Apps and Games --
125+
installHeroicGamesLauncher=false
125126
installSteam=false
126127
installWhisky=false
127128

128129
# ------------------------------
129130
# 3. User and App Settings
130131
# ------------------------------
131132
# -- 3.1 macOS Layout / User Interface --
133+
# ---- 3.1.1 Menu Bar ----
132134
dateTimeInMenubar=true
133-
useMissionControl=true
134135
enableFastUserswitching=true
136+
useMissionControl=true
135137
disableTransparency=true
138+
showBatteryPercentage=true # <-- only applied on MacBooks (MBA, MBP)
139+
# ---- 3.1.2 Window handling ----
140+
enableFullDraggableWindows=false
136141
showScrollbars=true
137-
disableNaturalScrolling=true
142+
# ---- 3.1.3 Text handling ----
138143
disableAnnoyingTextcorrections=true
139-
useRealNamesForContacts=true
144+
# ---- 3.1.4 Keyboard & Mouse ----
145+
disableNaturalScrolling=true
140146
enableTrackpadClicks=true # <-- only applied on MacBooks (MBA, MBP)
141-
showBatteryPercentage=true # <-- only applied on MacBooks (MBA, MBP)
142147
fasterMouseCursor=true
148+
fnKeyFunction='emoji' # Modes: off=Do nothing, emoji=Emojis & Symbols, language=Input sources, dictation=Start Dictation
149+
# ---- 3.1.5 Apple Apps ----
150+
useRealNamesForContacts=true
151+
showMusicNextSongPlaying=false
152+
showSubjectInMessagesApp=false
143153

144154
# -- 3.2 macOS Finder customizations --
145155
customizeFinder=true # <-- If false, below settings will have NO effect
@@ -155,22 +165,23 @@ minimalDock=false
155165
showLibraryFolder=true
156166
addUserApplicationsFolder=true
157167
addUserWebsitesFolder=true
158-
# -- 3.4.1 «Games» folder --
168+
# ---- 3.4.1 «Games» folder ----
159169
addUserGamesFolder=true
160170
useCustomGamesFolderIcon=true # <-- Requires Games Folder (addUserGamesFolder=TRUE)
161171
useCustomGamesFolderIconURL='https://swissmacuser.ch/wp-content/uploads/2021/06/Games-Folder-Icon-macOS-12-Monterey-detailed.png'
162-
# -- 3.4.2 Wallpapers (Desktop Pictures) --
172+
# ---- 3.4.2 Wallpapers (Desktop Pictures) ----
163173
downloadWallpapers=true # <-- Required to download any Wallpapers
164174
dynamicWallpaperExodus=false
165175
dynamicWallpaperFuji=false
166176
dynamicWallpaperISS=false
167177

168178
# -- 3.5 Terminal app settings --
169179
enableTerminalUtf8=true
170-
useCustomTerminalTheme=true # <-- Requires the URL from next line to download .terminal Theme file
180+
useCustomTerminalTheme=false # <-- Requires the URL from next line to download .terminal Theme file
171181
useCustomTerminalThemeURL='https://gist.githubusercontent.com/oliveratgithub/c9dde424966a7b9b5b7e9d1c28bf8f2e/raw/'
172182
useCustomTerminalConfigurations=false # If true, a URL is required to download and apply .zhsrc commands
173183
useCustomTerminalConfigurationsURL=''
174184

175185
# -- 3.6 Application Hardening --
176186
secureSafariBrowser=true
187+
removeTrashbinItemsPeriodically=true # Auto-remove items from Trash after 30 days

0 commit comments

Comments
 (0)