Beginning of macOS and Linux dotfiles separation and quality improvements

This commit is contained in:
2024-01-30 17:04:26 +00:00
parent a4b1677cb2
commit 6f8394aabe
20 changed files with 107 additions and 49 deletions

61
MacOS/README.md Normal file
View 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
View 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
View 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}"

View File

@@ -0,0 +1,2 @@
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="small-spacer-tile";}'
killall Dock

View File

@@ -0,0 +1,2 @@
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
killall Dock