Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp: Use DotBot #22

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@

macos_wm/skhd/sip_skhdrc
roles/zsh/files/secretsrc

zsh/secretsrc
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "dotbot"]
path = dotbot
url = https://github.com/anishathalye/dotbot
ignore = dirty
22 changes: 22 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
brew "asdf"
brew "yt-dlp"
brew "jq"

cask "1password-cli"
cask "1password"
cask "alacritty"
cask "brave-browser"
cask "caffeine"
cask "contexts"
cask "docker"
cask "firefox"
cask "forklift"
cask "maccy"
cask "monitorcontrol"
cask "plex"
cask "private-internet-access"
cask "raycast"
cask "stats"
cask "visual-studio-code"
cask "vlc"
cask "whatsapp"
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,28 @@ Config files for various applications I use across mac and linux

Has configurations for

* [Alacritty](https://github.com/jwilm/alacritty): Terminal emulator written in rust. Mac and Linux have separate configurations.
* [Tmux](https://github.com/tmux/tmux): terminal multiplexer. Probably the best thing in the world
* [Yabai](https://github.com/koekeishiya/yabai): i3 replacement for macOS
* [Alacritty](https://github.com/jwilm/alacritty): Terminal emulator
* [Tmux](https://github.com/tmux/tmux): Terminal multiplexer
* [Yabai](https://github.com/koekeishiya/yabai): i3 replacement for macOS, comes
with configurations for skhd, sketchybar and borders.
* [ohmyzsh](https://ohmyz.sh/): framework for managing your Zsh configuration

## Installation

Dotfiles are bundled using [dotbot](https://github.com/anishathalye/dotbot).

Update dotbot sub-module if required

```bash
git submodule update --remote dotbot
```

Then run the install command

```bash
./install
```

## License

This project is no license. Do whatever the f**k you want to do with it.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[general]
import = [
"~/Personal/dotfiles/roles/alacritty/files/alacritty_mac_base.toml",
"~/Personal/dotfiles/alacritty/alacritty_mac_base.toml",
"~/.config/alacritty/themes/themes/gruvbox_dark.toml",
]

Expand Down
74 changes: 0 additions & 74 deletions defaults

This file was deleted.

1 change: 1 addition & 0 deletions dotbot
Submodule dotbot added at 686db8
15 changes: 15 additions & 0 deletions install
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -e

CONFIG="install.conf.yaml"
DOTBOT_DIR="dotbot"

DOTBOT_BIN="bin/dotbot"
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

cd "${BASEDIR}"
git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive
git submodule update --init --recursive "${DOTBOT_DIR}"

"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" "${@}"
138 changes: 138 additions & 0 deletions install.conf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
- defaults:
link:
relink: true

- clean: ["~"]

- create:
- ~/.config/alacritty/themes

- link:
~/.zshrc:
path: zsh/zshrc
force: true
~/.config/.tmux.conf:
path: tmux/tmux.conf
create: true
~/.config/alacritty/alacritty.toml:
path: alacritty/alacritty_mac.toml
create: true
~/.config/common_wm/:
path: macos_wm/common
~/.config/sketchybar/:
path: macos_wm/sketchybar
~/.config/borders/:
path: macos_wm/borders
~/.config/yabai/:
path: macos_wm/yabai
~/.config/skhd/:
path: macos_wm/skhd

- shell:
- [git submodule update --init --recursive, Installing submodules]

- # Homebrew
command: |
if [[ $OSTYPE == darwin* ]] && ! which brew &>/dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
description: Checking Homebrew installation
quiet: true

- # Oh My Zsh
command: |
if [[ ! -d ~/.oh-my-zsh ]]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi
description: Checking Oh My Zsh
quiet: true

- # omz plugins
command: |
source internal/helper.sh

git clone https://github.com/changyuheng/zsh-interactive-cd.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/zsh-interactive-cd"
git clone https://github.com/TamCore/autoupdate-oh-my-zsh-plugins "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/autoupdate"
git clone https://github.com/Aloxaf/fzf-tab "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fzf-tab"
git clone https://github.com/MichaelAquilina/zsh-you-should-use.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/you-should-use"
git clone https://github.com/zsh-users/zsh-autosuggestions "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions"
git clone https://github.com/zsh-users/zsh-completions "${ZSH_CUSTOM:=$HOME/.oh-my-zsh/custom}/plugins/zsh-completions"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting"
git clone https://github.com/wfxr/forgit.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/forgit"
git clone https://github.com/spaceship-prompt/spaceship-prompt.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/spaceship-prompt" --depth=1

ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"

is_installed zoxide || brew install zoxide fzf thefuck
is_installed fzf || brew install fzf
is_installed thefuck || brew install thefuck
description: Installing Oh My Zsh plugins
quiet: true

- # Tmux
command: |
source internal/helper.sh
is_installed tmux || brew install tmux
description: Installing Tmux
quiet: true

- # Tmux plugins
command: |
if [ ! -e "$HOME/.tmux/plugins/tpm" ]; then
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# Install TPM plugins.
# TPM requires running tmux server, as soon as `tmux start-server` does not work
# create dump __noop session in detached mode, and kill it when plugins are installed
tmux new -d -s __noop >/dev/null 2>&1 || true
tmux set-environment -g TMUX_PLUGIN_MANAGER_PATH "$HOME/.tmux/plugins"
"$HOME"/.tmux/plugins/tpm/bin/install_plugins || true
tmux kill-session -t __noop >/dev/null 2>&1 || true
fi
quiet: true

- # Alacritty
command: brew install --cask alacritty
description: Installing Alacritty
quiet: true

- # Alacritty themes
command: git clone https://github.com/alacritty/alacritty-theme "$HOME/.config/alacritty/themes" >/dev/null 2>&1 || true
description: Installing Alacritty themes
quiet: true

- # Font
command: brew install --cask font-hack-nerd-font
description: Installing Hack Nerd Font
quiet: true

- # MacOS Window Management
command: |
brew tap koekeishiya/formulae
brew install yabai skhd jq

brew tap FelixKratz/formulae
brew install sketchybar borders
brew services start sketchybar
curl -L https://github.com/kvndrsslr/sketchybar-app-font/releases/download/v2.0.32/sketchybar-app-font.ttf -o $HOME/Library/Fonts/sketchybar-app-font.ttf
brew install --cask sf-symbols
description: Installing Yabai
quiet: true

- # Post-yabai install
command: |
macos_wm/post_yabai_installation.sh
description: Configuring Yabai
quiet: true

- # MacOS Optimizations
command: |
macos_optimizations
description: Configuring MacOS
quiet: true

# Commented out because it takes too long. Only run this on a fresh install.
# - # Brew
# command: brew bundle --file=Brewfile
# description: Installing Brew packages
# quiet: true
# stdout: true
11 changes: 11 additions & 0 deletions internal/helper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

function is_installed() {
local program=$1

if command -v "$program" &>/dev/null; then
return 0
else
return 1
fi
}
Loading