Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xvzc committed Apr 16, 2024
1 parent 7161ea8 commit 468fce4
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 92 deletions.
11 changes: 9 additions & 2 deletions .chezmoiexternal.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,15 @@
refreshPeriod = "168h"

[".config/nvim"]
type = "git-repo"
url = "https://[email protected]/xvzc/nvim.git"
type = "git-repo"
url = "https://github.com/xvzc/nvim.git"
exact = true
stripComponents = 1
refreshPeriod = "168h"

[".config/assets"]
type = "git-repo"
url = "https://github.com/xvzc/assets.git"
exact = true
stripComponents = 1
refreshPeriod = "168h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
local palette = {
black = "#2c2c2c",
grey = "#757474",
grey = "#8c8787",
red = "#ba5458",
pink = "#cc6666",
olive = "#b5bd68",
green = "#b9ca4a",
light_orange = "#ebba7a",
yellow = "#e6b137",
carolina = "#b3cbe3",
sky = "#89a4f0",
ocean = "#89a4f0",
dimmed_ilac = "#6c6882",
violet = "#b294bb",
plum = "#c397d8",
Expand All @@ -33,7 +33,7 @@ local colors = {
palette.red,
palette.green,
palette.light_orange,
palette.carolina,
palette.ocean,
palette.violet,
palette.aquamarine,
palette.antique_white,
Expand All @@ -44,7 +44,7 @@ local colors = {
palette.pink,
palette.olive,
palette.yellow,
palette.sky,
palette.ocean,
palette.plum,
palette.mint,
palette.lemon_white,
Expand Down
4 changes: 4 additions & 0 deletions dot_gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@

[includeIf "gitdir:~/work/"]
path = ~/.gitconfig

[init]
defaultBranch = main

File renamed without changes.
4 changes: 2 additions & 2 deletions dot_wezterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ config.default_cursor_style = "BlinkingBlock"
config.audible_bell = "Disabled"

config.window_background_opacity = 0.93
config.colors = require("themes/ontario")
config.colors = require("themes/miami")

config.window_padding = {
left = 4,
Expand All @@ -26,7 +26,7 @@ config.window_padding = {

config.font = wezterm.font_with_fallback({
"JetBrainsMonoNL Nerd Font",
"hesalche",
"D2Coding",
})

config.keys = {
Expand Down
25 changes: 12 additions & 13 deletions dot_zsh/alias.zsh.tmpl → dot_zsh/alias.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,12 @@ if [ -x "$(command -v eza)" ]; then
alias la='eza -alg --sort=type'
fi

alias g++='g++ -std=c++17'

# {{ if eq .osid "darwin" }}
alias ofd='open .'
# {{ else if eq .osid "linux-arch" }}
alias open='thunar'
# {{ end }}

alias pgh='GITHUB_TOKEN=$PERSONAL_GITHUB_TOKEN gh'
alias wgh='GITHUB_TOKEN=$WORK_GITHUB_TOKEN gh'
alias 'bat'='bat --style=plain'
alias 'bat -nu'='bat --style=numbers'

alias live-server='live-server --port=8080 --browser=chromium'
_is_linux && alias open='thunar'

alias bat='bat --style=plain'
alias 'bat -nu'='bat --style=numbers'
alias g++='g++ -std=c++17'

alias lazygit='lazygit --use-config-file=$HOME/.config/lazygit/config.yml'
alias lg='lazygit --use-config-file=$HOME/.config/lazygit/config.yml'
Expand All @@ -55,6 +46,11 @@ alias 8='cd -8 &> /dev/null'
alias 9='cd -9 &> /dev/null'


# ┌─────┐
# │ GIT │
# └─────┘
alias ggpush='git push origin "$(git_current_branch)"'

# ┌─────────┐
# │ CHEZMOI │
# └─────────┘
Expand Down Expand Up @@ -122,6 +118,9 @@ if [ -x "$(command -v kubectl)" ]; then

alias kcv='kubectl config view'
alias kaf='kubectl apply -f'

alias kx='kubectl exec'
alias kxi='kubectl exec -it'
fi

# ┌───────────┐
Expand Down
16 changes: 8 additions & 8 deletions dot_zsh/style.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export LS_COLORS="\
*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90: \
*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90: \
*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90: \
*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:*.pub=00;00:*.zwc=00;90: \
*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90: \
*.pub=00;00:*.zwc=00;90: \
"

export EZA_COLORS="da=00;00:uu=01;37:gu=01;37:"
Expand All @@ -42,10 +43,11 @@ ZSH_HIGHLIGHT_STYLES[single-quoted-argument]=fg=yellow
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]=fg=yellow
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]=fg=cyan
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]=fg=cyan
ZSH_HIGHLIGHT_STYLES[comment]='fg=#7d807e'
ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=#eb87ff'
# ZSH_HIGHLIGHT_STYLES[comment]='fg=#7d807e'
# ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=#eb87ff'

zstyle :prompt:pure:path color '#89a4f0'
# zstyle :prompt:pure:path color '#89a4f0'
zstyle :prompt:pure:path color blue

zstyle :prompt:pure:git:dirty color red
zstyle :prompt:pure:git:branch color cyan
Expand All @@ -64,10 +66,8 @@ zstyle :prompt:pure:virtualenv show yes

# Do menu-driven completion.
zstyle ':completion:*' menu select
# zstyle ':completion:*:*:git:*' user-commands login:'git_login' \
# list-pr:'hub_list_pr' \
# make-pr:'hub_make_pr' \
# merge-pr:'hub_make_pr'
zstyle ':completion:*:*:git:*' user-commands \
login:'authenticate current git repository with ssh key'

# formatting and messages
zstyle ':completion:*' verbose yes
Expand Down
2 changes: 1 addition & 1 deletion dot_zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export DOT_ZSH=$HOME/.zsh

plugins=(
git
# git
fzf
vi-mode
zsh-defer
Expand Down
28 changes: 0 additions & 28 deletions init_private_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,10 @@ check-1password() {
fi
}

cur_os=$(uname)

assets_dir="$HOME/.config/assets"

# Install packages
if [ "$cur_os" = "Darwin" ]; then
font_dir=~/Library/Fonts/
brewfile="$HOME/.local/share/chezmoi/setup/Brewfile.personal"
if ! brew bundle --no-lock --no-upgrade --file="$brewfile"; then
error "Filed to install packages"
fi

source ~/.local/share/chezmoi/setup/macos-setup.sh && all
elif [ "$cur_os" = "Linux" ]; then
font_dir=~/.local/share/fonts/
fi

check-1password

op read "op://Personal/SSH Github xvzc/public key" >~/.ssh/xvzc.pub &&
chmod 600 ~/.ssh/xvzc.pub

op read "op://Personal/SSH Arch Linux/public key" >~/.ssh/arch.pub &&
chmod 600 ~/.ssh/arch.pub

if [ -d "$assets_dir/.git" ]; then
echo "'$assets_dir/.git' already exists."
git --git-dir "$assets_dir/.git" remote set-url origin [email protected]:xvzc/assets.git
else
git clone [email protected]:xvzc/assets.git "$assets_dir"
fi

cp ~/.config/assets/fonts/hesalche/ttf/hesalche-Light.ttf "$font_dir"
cp ~/.config/assets/fonts/hesalche/ttf/hesalche-Regular.ttf "$font_dir"

21 changes: 12 additions & 9 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ error() {
}

require-sudo() {
sudo -v --prompt "Administrator privilege required. Please type your local password: "
sudo -v --prompt "Administrator privilege required. Please type your password: "

# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do
Expand All @@ -17,7 +17,7 @@ require-sudo() {
done 2>/dev/null &
}

check-or-install-xcode() {
install-xcode() {
if ! xcode-select --print-path &>/dev/null; then
# Install XCode Command Line Tools.
xcode-select --install &>/dev/null
Expand All @@ -29,7 +29,7 @@ check-or-install-xcode() {
fi
}

check-or-install-brew() {
install-brew() {
if ! /opt/homebrew/bin/brew shellenv 2>&1; then
echo "homdbrew not found. installing.."
require-sudo
Expand All @@ -47,7 +47,7 @@ check-or-install-brew() {
fi
}

check-or-install-chezmoi() {
install-chezmoi() {
if type chezmoi >/dev/null 2>&1; then
echo "Found chezmoi at $(whereis chezmoi). Skipping install."
else
Expand All @@ -73,13 +73,15 @@ esac
echo "Detected OS: ${machine}"

if [ "$machine" == "Mac" ]; then
check-or-install-xcode
check-or-install-chezmoi
check-or-install-brew
brewfile="$HOME/.local/share/chezmoi/setup/Brewfile.essential"
install-xcode
install-chezmoi
install-brew
brewfile="$HOME/.local/share/chezmoi/setup/Brewfile"
if ! brew bundle --no-lock --no-upgrade --file="$brewfile"; then
error "Failed to install packages"
error "Failed to install MacOS packages"
fi

source "$HOME/.local/share/chezmoi/setup/macos-setup.sh" && all
elif [ "$machine" == "Linux" ]; then
echo "Installing Linux packages.."
yay -S --needed --noconfirm - <~/.local/share/chezmoi/setup/aur_packages.txt
Expand All @@ -102,5 +104,6 @@ if ! command -v cargo &> /dev/null; then
curl https://sh.rustup.rs -sSf | sh
fi

# Install neovim version manager
bob install nightly
bob use nightly
27 changes: 24 additions & 3 deletions setup/Brewfile.personal → setup/Brewfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
tap "homebrew/bundle"
tap "homebrew/services"
tap "koekeishiya/formulae"
tap "homebrew/cask-fonts"
tap "daipeihust/tap"
tap "kardolus/chatgpt-cli"
brew "[email protected]"
brew "go"
brew "node@18", link: :force
brew "bob"
brew "bat"
brew "chezmoi"
brew "eza"
brew "fd"
brew "fzf"
brew "git"
brew "tmux"
brew "tmuxinator"
brew "tree"
brew "mas"
brew "luarocks"
brew "daipeihust/tap/im-select"
brew "kardolus/chatgpt-cli/chatgpt-cli"
brew "cmake"
Expand All @@ -13,11 +31,14 @@ brew "ranger"
brew "ripgrep"
brew "terraform"
brew "wakeonlan"
mas "KakaoTalk ", id: 869223134
mas "Gifski ", id: 1351639930
cask "font-jetbrains-mono-nerd-font"
cask "font-d2coding"
cask "wezterm"
cask "1password"
cask "1password-cli"
cask "google-chrome"
cask "discord"
cask "alfred"
cask "bettertouchtool"
mas "KakaoTalk ", id: 869223134
mas "Gifski ", id: 1351639930
21 changes: 0 additions & 21 deletions setup/Brewfile.essential

This file was deleted.

2 changes: 1 addition & 1 deletion setup/Default.bttpreset
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,4 @@
"BTTPresetSnapAreas" : [

]
}
}

0 comments on commit 468fce4

Please sign in to comment.