Dotfiles v2.0
This commit is contained in:
2
scripts/brewBundle.sh
Normal file
2
scripts/brewBundle.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
echo "Generate: brew bundle dump --describe"
|
||||
echo "Restore: brew bundle --file FileToRestore"
|
||||
18
scripts/color.sh
Executable file
18
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"
|
||||
|
||||
BOLD="\e[1m"
|
||||
FAINT="\e[2m"
|
||||
ITALIC="\e[3m"
|
||||
UNDERLINE="\e[4m"
|
||||
|
||||
ENDCOLOR="\e[0m"
|
||||
|
||||
# Example usage: echo -e "${GRAY}Gray text${ENDCOLOR}"
|
||||
2
scripts/macos-add-small-spacer.sh
Executable file
2
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
scripts/macos-add-spacer.sh
Executable file
2
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
|
||||
22
scripts/moveAppsToBrew.sh
Executable file
22
scripts/moveAppsToBrew.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# List all installed apps
|
||||
all_apps=(/Applications/*)
|
||||
|
||||
# Loop through each app
|
||||
for app in "${all_apps[@]}"; do
|
||||
# Extract the app name without the extension (if any)
|
||||
app_name="${app##*/}"
|
||||
app_name="${app_name%.*}" # Removes everything after the last dot
|
||||
|
||||
# Check if the app name exists in a brew cask
|
||||
brew search $app_name &> /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Found $app_name in Homebrew. Installing..."
|
||||
brew install --cask --force "$app_name"
|
||||
else
|
||||
echo "$app_name not found in Homebrew."
|
||||
fi
|
||||
done
|
||||
|
||||
echo "All checks completed."
|
||||
20
scripts/symlink-files.sh
Normal file
20
scripts/symlink-files.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Function to symlink all files in one directory, to another.
|
||||
# Example use-case: Symlink all files in .dotfiles to the $HOME directory.
|
||||
# Usage example: symlink_files $source $destination
|
||||
|
||||
symlink_files() {
|
||||
# Check if source and destination directories exist
|
||||
if [ ! -d "$1" ] || [ ! -d "$2" ]; then
|
||||
echo "Error: Source or destination directory does not exist!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Loop through each file in the source directory (including hidden)
|
||||
for file in $(find "$1" -type f -print); do
|
||||
filePath=$(realpath $file)
|
||||
ln -s "$filePath" "$2/$(basename "$file")"
|
||||
echo "Linked: $file to $2/$(basename "$file")"
|
||||
done
|
||||
}
|
||||
Reference in New Issue
Block a user