Beginning of macOS and Linux dotfiles separation and quality improvements
This commit is contained in:
61
MacOS/README.md
Normal file
61
MacOS/README.md
Normal file
@@ -0,0 +1,61 @@
|
||||
## MacOS Commands (built-in)
|
||||
|
||||
**Password-protected Zip:**
|
||||
```sh
|
||||
zip -e protected.zip /file/to/protect/
|
||||
```
|
||||
|
||||
**Remove dotfiles:**
|
||||
```sh
|
||||
dot_clean .
|
||||
```
|
||||
|
||||
**Show all files in finder:**
|
||||
```sh
|
||||
defaults write com.apple.Finder AppleShowAllFiles 1
|
||||
```
|
||||
|
||||
**Search using Spotlight:**
|
||||
```sh
|
||||
mdfind "file name”
|
||||
```
|
||||
|
||||
**Rebuild Spotlight index:**
|
||||
```sh
|
||||
mdutil -E
|
||||
```
|
||||
|
||||
**Turn off Spotlight indexing:**
|
||||
```sh
|
||||
dutil -i off
|
||||
```
|
||||
|
||||
**Repair Disk permissions:**
|
||||
```sh
|
||||
sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume /
|
||||
```
|
||||
|
||||
**Generate SHA-1 digest of a file:**
|
||||
```sh
|
||||
/usr/bin/openssl sha1 download.dmg
|
||||
```
|
||||
|
||||
**Disable sleep temporarily:**
|
||||
```sh
|
||||
caffeinate
|
||||
```
|
||||
|
||||
**Open multiple instances of a program:**
|
||||
```sh
|
||||
open multiple instances open -n /Applications/Safari.app/
|
||||
```
|
||||
|
||||
**Check network speed:**
|
||||
```sh
|
||||
networkQuality
|
||||
```
|
||||
|
||||
**Convert files (txt, html, rtf, rtfd, doc, docx):**
|
||||
```sh
|
||||
textutil -convert html journal.doc
|
||||
```
|
||||
26
MacOS/macos.sh
Executable file
26
MacOS/macos.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#! /bin/zsh
|
||||
|
||||
source ./scripts/color.sh
|
||||
|
||||
# Copy configs
|
||||
echo -e "${GREEN}[+] Configuring system...${ENDCOLOR}"
|
||||
cp -rf ./homeConfigs/.* ~
|
||||
|
||||
# Disable dock delay
|
||||
echo -e "${GREEN}[+] Disabling dock autohide delay...${ENDCOLOR}"
|
||||
defaults write com.apple.dock autohide-delay -float 0
|
||||
defaults write com.apple.dock autohide -int 1
|
||||
#defaults write com.apple.dock autohide-time-modifier -int 0 #Disable animation
|
||||
killall Dock
|
||||
|
||||
# Hide dotfiles folder
|
||||
echo -e "${GREEN}[+] Hiding dotfiles folder from finder...${ENDCOLOR}"
|
||||
chflags hidden ~/dotfiles
|
||||
# Unhide: chflags nohidden /path/to/unhide/
|
||||
|
||||
# Update MacOS
|
||||
echo -e "${GREEN}[+] Updating MacOS...${ENDCOLOR}"
|
||||
sudo softwareupdate -ia
|
||||
|
||||
echo -e "${GREEN}${BOLD}[i] All done.${ENDCOLOR}"
|
||||
say "All done."
|
||||
18
MacOS/scripts/color.sh
Executable file
18
MacOS/scripts/color.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#! /bin/bash
|
||||
|
||||
RED="\e[31m"
|
||||
GREEN="\e[32m"
|
||||
YELLOW="\e[33m"
|
||||
BLUE="\e[34m"
|
||||
MAGENTA="\e[35m"
|
||||
CYAN="\e[36m"
|
||||
GRAY="\e[90m"
|
||||
ENDCOLOR="\e[0m"
|
||||
|
||||
ENDCOLOR="\e[0m"
|
||||
BOLD="\e[1m"
|
||||
FAINT="\e[2m"
|
||||
ITALIC="\e[3m"
|
||||
UNDERLINE="\e[4m"
|
||||
|
||||
# Example usage: echo -e "${GRAY}Gray text${ENDCOLOR}"
|
||||
2
MacOS/scripts/macos-add-small-spacer.sh
Executable file
2
MacOS/scripts/macos-add-small-spacer.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="small-spacer-tile";}'
|
||||
killall Dock
|
||||
2
MacOS/scripts/macos-add-spacer.sh
Executable file
2
MacOS/scripts/macos-add-spacer.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
|
||||
killall Dock
|
||||
Reference in New Issue
Block a user