Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pgaijin66 committed Jun 2, 2024
1 parent 8fb6309 commit 87f7bba
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 18 deletions.
135 changes: 128 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,138 @@
### My local development setup ( dotfiles )
# Dotfiles Setup Script

Following are my dotfiles condifureation for my workstation.
This repository contains a script to set up your development environment by installing necessary packages and configuring dotfiles. The setup script handles the installation of Homebrew, various packages, and the configuration of several tools and applications.

## Features

### Setup
- **Homebrew Installation**: Installs Homebrew if not already installed.
- **Package Installation**: Installs a list of useful packages for development.
- **Configuration**: Sets up configurations for Zsh, Yabai, skhd, Neovim, Kitty, and Git.
- **Directory Setup**: Creates necessary directories for your projects.
- **Service Management**: Starts and restarts services for skhd and yabai.

## Running script

To get started, clone the repository and run the setup script:

```bash
git clone <your-repo-url>
cd <your-repo-name>
/bin/bash bootstrap.sh
```

## Script Breakdown

### Configuration Directory
Sets up the configuration directory:

```bash
export CONFIG_HOME=${XDG_CONFIG_HOME:-"$HOME"/.config}
if [[ ! -d "$CONFIG_HOME" ]]; then
mkdir -p "$CONFIG_HOME"
fi
```
$ /bin/bash bootstrap.sh

### Homebrew
Checks if Homebrew is installed and installs it if not:

```bash
function install_brew {
if [[ ! $(command -v brew) ]]; then
echo "No brew installation found, installing..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew update && brew upgrade
else
echo "brew is installed, nothing to do here..."
fi
}
```

*Info: Some installations might require you to approve and enable security and accessibility settings.*
### Package Installation

Installs a list of useful packages:

```bash
function install_packages {
brew install bat gcc ripgre..
}
```

### Additional Tools

Installs and configures additional tools like skhd, Kitty, Terraform, Python, and Ansible:

```bash
function install_skhd {
brew install koekeishiya/formulae/skhd
skhd --start-service
}

function install_kitty {
/bin/bash -c "$(curl -fsSL https://sw.kovidgoyal.net/kitty/installer.sh)"
}

function install_terraform {
brew tap hashicorp/tap
brew install hashicorp/tap/terraform
}

function install_python {
brew install [email protected]
curl -O https://bootstrap.pypa.io/get-pip.py
}

function install_ansible {
brew install ansible
}
```

### Dotfiles Setup
Sets up dotfiles for Zsh, Yabai, and skhd:

```bash
function setup_dotfiles {
DOTFILES="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

if [ ! -d "$HOME/.oh-my-zsh" ]; then
KEEP_ZSHRC=yes sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi
ln -sf "$DOTFILES"/zsh/zshrc "$HOME"/.zshrc
ln -sf "$DOTFILES"/yabai/yabairc "$HOME"/.yabairc
chmod +x ~/.yabairc
ln -sf "$DOTFILES"/skhd/skhdrc "$HOME"/.skhdrc
chmod +x ~/.skhdrc
}
```

### Directory Setup

Creates required directories:

```bash
function setup_directories {
mkdir -p ~/src/personal/github ~/src/work
}
```

### Configuration Files Setup
Sets up configuration files for Neovim, Kitty, and Git:

```bash
function setup_config_files {
rm -rf "$HOME"/.config/nvim
ln -s "$DOTFILES"/nvim "$HOME"/.config/nvim
rm -rf "$HOME"/.config/kitty
ln -s "$DOTFILES"/kitty "$HOME"/.config/kitty
ln -sf "$DOTFILES"/git/gitconfig "$HOME"/.gitconfig
}
```

### Author
### Start Services
Restarts services for skhd and yabai:

Prabesh Thapa ( sthapaprabesh2020(at)gmail(dot)com )
```bash
function start_services {
skhd --restart-service
yabai --restart-service
}
```
16 changes: 6 additions & 10 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,25 +156,21 @@ function setup_config_files {
install_brew
install_packages
install_skhd
# install_kitty
install_kitty
install_terraform
install_python
install_ansible


# Additional setup steps
setup_dotfiles
# setup_directories
setup_directories
setup_config_files


# TODO: Packages to install and configure
# redis-cli, gnupg, black, python linters, go linters, docker-compose, cdk8s, tflint, terraform, , helm, nettle, vegeeta, node, hashicorp vault, yamllint, pyyaml, kind, ngrok, docker, vagrant, secret scanning tools, bc ( better commit ), rectangle, brave, obsidian, wireshark, virtualbox, mongo compass, table plus, postman burpsuit

# function start_services {
# runcmd skhd --restart-service
# runcmd yabai --restart-service
# }
function start_services {
runcmd skhd --restart-service
runcmd yabai --restart-service
}


echo "completed"
12 changes: 11 additions & 1 deletion zsh/zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export GPG_TTY=$(tty)

# Alias

PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/usr/local/go/bin"
PATH="$PATH:/Users/pthapa/App:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/usr/local/go/bin"
# Tihis is the line adds $GOPATH/bin to $PATH
PATH=$(go env GOPATH)/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:$PATH

Expand Down Expand Up @@ -114,8 +114,18 @@ alias kping='kctl run httping -it --image bretfisher/httping --image-pull-policy
function kyaml() { kubectl get "$@" -o yaml | kubectl-neat }
alias krmfailed='kctl delete pods --field-selector=status.phase=Failed'


function lgn() { cia sso -p "$@" && cluster_login }

alias kx='kubectx'

alias prd='export AWS_PROFILE=prod && kx production'
alias pex='export AWS_PROFILE=prod && kx prd-external'
alias pit='export AWS_PROFILE=prod && kx prd-internal'
alias stg='export AWS_PROFILE=pre-prod && kx devtest'
alias dev='export AWS_PROFILE=pre-prod && kx dev'
alias tst='export AWS_PROFILE=pre-prod && kx sre-test'

# FZF
alias sd="cd ~ && \$(find Documents work Desktop Downloads -type d -maxdepth 4 | fzf)"

Expand Down

0 comments on commit 87f7bba

Please sign in to comment.