diff --git a/.brew_lists/.gitingnore b/.brew_lists/.gitingnore deleted file mode 100755 index 397b4a7..0000000 --- a/.brew_lists/.gitingnore +++ /dev/null @@ -1 +0,0 @@ -*.log diff --git a/.brew_lists/brew_list.txt.new b/.brew_lists/brew_list.txt.new deleted file mode 100755 index ce4781b..0000000 --- a/.brew_lists/brew_list.txt.new +++ /dev/null @@ -1,104 +0,0 @@ -autoconf -bat -bats-core -brotli -c-ares -ca-certificates -certifi -coreutils -curl -docker -docker-completion -fd -fzf -gcc -gettext -gh -git -gmp -go -hyperfine -ical-buddy -icu4c -isl -jq -julia -krb5 -libevent -libgit2 -libidn2 -liblinear -libmpc -libnghttp2 -libssh2 -libtermkey -libunistring -libuv -libvterm -libyaml -lua -luajit -luv -lz4 -m4 -marp-cli -mbedtls@2 -mpdecimal -mpfr -msgpack -ncurses -neovim -nmap -node -oniguruma -openblas -openldap -openlibm -openssl@3 -p7zip -pcre -pcre2 -pkg-config -postgresql@14 -pyenv -pygments -python-certifi -python-packaging -python-setuptools -python@3.11 -python@3.12 -pyyaml -readline -ripgrep -rtmpdump -skhd -sqlite -stow -tmux -tree -tree-sitter -unibilium -utf8proc -xz -yabai -zoxide -zsh -zstd -base -bitwarden -docker -drawio -firefox -google-drive -iterm2 -logi-options-plus -maccy -microsoft-auto-update -microsoft-teams -miniforge -postman -pycharm -sparkle -spotify -vscodium -zotero diff --git a/.brew_lists/cask_list.txt.new b/.brew_lists/cask_list.txt.new deleted file mode 100755 index 2f9e4a6..0000000 --- a/.brew_lists/cask_list.txt.new +++ /dev/null @@ -1,18 +0,0 @@ -base -bitwarden -docker -drawio -firefox -google-drive -iterm2 -logi-options-plus -maccy -microsoft-auto-update -microsoft-teams -miniforge -postman -pycharm -sparkle -spotify -vscodium -zotero diff --git a/.gitignore b/.gitignore index a771ca0..dcf9315 100755 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *.log __pycache__* -brew_lists/cask_list.txt.new -brew_lists/brewa-list.txt.new +.brew_lists/* diff --git a/add_yaml_header.sh b/add_yaml_header.sh new file mode 100755 index 0000000..15423fd --- /dev/null +++ b/add_yaml_header.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Function to add '---' to YAML files if not present +add_yaml_header() { + while IFS= read -r file; do + if ! grep -q '^---' "$file"; then + echo "Adding --- to $file" + sed -i '1s/^/---\n/' "$file" + fi + done < <(fd -t f -e yaml -e yml "$1") +} + +# Check if a directory is provided +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + +# Call the function with the provided directory +add_yaml_header "$1" + diff --git a/docker_check b/docker_check index 5714ec2..89f3211 100755 --- a/docker_check +++ b/docker_check @@ -8,7 +8,7 @@ start_docker() { } # Check if Docker is installed -if ! command -v docker &> /dev/null; then +install_docker(){ echo "Docker is not installed." read -p "Do you want to install Docker using Homebrew? (y/n): " choice if [ "$choice" == "y" ]; then @@ -19,6 +19,24 @@ if ! command -v docker &> /dev/null; then echo "Docker is required to run this script. Exiting." exit 1 fi +} + +# Check if docker-compose is installed +install_docker_compose() { + echo "docker-compose is not installed." + read -p "Do you want to install docker-compose using Homebrew? (y/n): " choise + if [ "$choice" == "y" ]; then + brew install docker-compose + echo "Docker has been installed. Please restart this script." + exit 0 + else + echo "Docker is required to run this script. Exiting." + exit 1 + fi +} + +if ! command -v docker &> /dev/null; then + install_docker fi # Check if Docker is running @@ -30,7 +48,9 @@ fi if [ "$1" == "docker-compose" ]; then # If docker-compose is called, check if Docker is running again if [ "$(docker info >/dev/null 2>&1 && echo "running")" != "running" ]; then - start_docker + if ! command -v docker-compose &> /dev/null; then + start_docker + fi fi fi diff --git a/setup_dev_env b/setup_dev_env index a72495c..196a24f 100755 --- a/setup_dev_env +++ b/setup_dev_env @@ -87,8 +87,13 @@ if ! command_exists zsh; then fi # Check and install tmux -if ! command_exists tmux; then - install_dependencies tmux +# if ! command_exists tmux; then +# install_dependencies tmux +# fi + +# Check and install Neovim +if ! command_exists nvim; then + install_dependencies neovim fi # Install Go @@ -132,17 +137,14 @@ esac # Create symbolic links for dotfiles ln -s "$DOTFILES_DIR/zsh/.zshrc" ~/.zshrc -ln -s "$DOTFILES_DIR/tmux/.tmux.conf" ~/.tmux.conf +# ln -s "$DOTFILES_DIR/tmux/.tmux.conf" ~/.tmux.conf ln -s "$DOTFILES_DIR/nvim" ~/.config/nvim # Source configurations for the current session source ~/.zshrc -tmux source ~/.tmux.conf +# tmux source ~/.tmux.conf -# Inform the user and wait for input -echo "Zsh, Tmux, Neovim, Go, and development tools configurations applied." - # Enable notifications if the flag is set if [ "$ENABLE_NOTIFICATION" == true ]; then echo "Press Enter to start Zsh and Tmux." @@ -154,3 +156,4 @@ fi # Start Zsh and Tmux zsh + diff --git a/wzp b/wzp new file mode 100755 index 0000000..5fb9e59 --- /dev/null +++ b/wzp @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# Wezterm Project - Start a new wezterm project + +PROJECTS_DIR="$HOME/.config/wezterm/projects" + +project="" + +if [[ -z "$1" ]]; then + # List all files in projects directory. Only keep the file name without the extension + project=$(fd -d 1 -e lua -t f -t l . ~/.config/wezterm/projects --print0 | xargs -0 -n 1 basename | sed 's/\.lua$//' | fzf --cycle --layout=reverse) +else + if [[ ! -e "$PROJECTS_DIR/$1.lua" ]]; then + echo "The project file '$PROJECTS_DIR/$1.lua' not exists" + exit 1 + fi + project="$1" +fi + +if [[ -z $project ]]; then + echo "No project selected" + exit 1 +fi + +WZ_PROJECT="$project" wezterm start --always-new-process & +