Beginning of macOS and Linux dotfiles separation and quality improvements

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

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
.DS_Store
*/*.DS_Store
.Trash

View File

@@ -187,7 +187,7 @@ fi
# Copy configs
echo -e "${GREEN}[+] Configuring system...${ENDCOLOR}"
cp -rf homeConfigs/.* ~
cp -rf ./homeConfigs/.* ~
# Enable bash case insensitive completion
cat /etc/inputrc | grep completion-ignore-case

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

View File

@@ -1 +0,0 @@
PATH="/usr/local/bin:$PATH"

View File

@@ -1 +0,0 @@
eval "$(/opt/homebrew/bin/brew shellenv)"

View File

@@ -1,40 +0,0 @@
#! /bin/zsh
source ./scripts/p.sh
source ./scripts/color.sh
dist=$(d)
if [ $dist != 3 ]; then
echo -e "${RED}[E] Run linux.sh for Linux instead.${ENDCOLOR}"
return 1
fi
# 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
# Install brew
echo -e "${GREEN}[+] Installing homebrew...${ENDCOLOR}"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Enable brew
eval "$(/opt/homebrew/bin/brew shellenv)"
# Install Nerd Font
if p c font-jetbrains-mono-nerd-font &>/dev/null; then
echo -e "${GREEN}[i] JetBrains font is installed.${ENDCOLOR}"
else
echo -e "${GREEN}[+] Installing JetBrains font.${ENDCOLOR}"
p i font-jetbrains-mono-nerd-font
echo -e "${GREEN}[i] JetBrains font installed.${ENDCOLOR}"
fi
echo -e "${GREEN}${BOLD}[i] All done.${ENDCOLOR}"

View File

@@ -1,6 +0,0 @@
#! /bin/bash
brew doctor
brew update
brew upgrade
brew list