mirror of
https://github.com/chenasraf/dotfiles.git
synced 2026-05-18 01:29:06 +00:00
feat: use sofmani instead of zplug
This commit is contained in:
@@ -374,15 +374,79 @@ install:
|
||||
type: pipx
|
||||
- name: black
|
||||
type: pipx
|
||||
- name: zplug
|
||||
type: shell
|
||||
check_installed: test -d ~/.zplug
|
||||
check_has_update: exit 0
|
||||
|
||||
# Local dotfiles plugin folder
|
||||
- name: local-plugins
|
||||
type: rsync
|
||||
tags: plugin
|
||||
opts:
|
||||
command: |
|
||||
curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh
|
||||
zplug install
|
||||
zplug load --verbose
|
||||
update_command: |
|
||||
source $HOME/.dotfiles/zplug.init.zsh
|
||||
zplug update
|
||||
source: ~/.dotfiles/plugins
|
||||
destination: ~/.local/share/zsh/plugins
|
||||
flags: --delete
|
||||
|
||||
# chenasraf/git-open plugin
|
||||
- name: chenasraf/git-open
|
||||
type: git
|
||||
tags: plugin
|
||||
opts:
|
||||
ref: master
|
||||
destination: ~/.local/share/zsh/plugins
|
||||
|
||||
# mfaerevaag/wd
|
||||
- name: mfaerevaag/wd
|
||||
type: git
|
||||
tags: plugin
|
||||
opts:
|
||||
destination: ~/.local/share/zsh/plugins
|
||||
|
||||
# powerlevel10k theme
|
||||
- name: romkatv/powerlevel10k
|
||||
type: git
|
||||
tags: plugin
|
||||
opts:
|
||||
ref: master
|
||||
destination: ~/.local/share/zsh/plugins
|
||||
|
||||
# zsh-autosuggestions
|
||||
- name: zsh-users/zsh-autosuggestions
|
||||
type: git
|
||||
tags: plugin
|
||||
opts:
|
||||
destination: ~/.local/share/zsh/plugins
|
||||
|
||||
# tmux plugins
|
||||
- name: tmux-plugins/tpm
|
||||
type: git
|
||||
tags: plugin
|
||||
opts:
|
||||
destination: ~/.tmux/plugins
|
||||
|
||||
- name: catppuccin/tmux
|
||||
type: git
|
||||
tags: plugin
|
||||
opts:
|
||||
destination: ~/.tmux/plugins
|
||||
|
||||
- name: tmux-plugins/tmux-online-status
|
||||
type: git
|
||||
tags: plugin
|
||||
opts:
|
||||
destination: ~/.tmux/plugins
|
||||
|
||||
- name: tmux-plugins/tmux-battery
|
||||
type: git
|
||||
tags: plugin
|
||||
opts:
|
||||
destination: ~/.tmux/plugins
|
||||
|
||||
- name: tmux-plugins/tmux-cpu
|
||||
type: git
|
||||
tags: plugin
|
||||
opts:
|
||||
destination: ~/.tmux/plugins
|
||||
|
||||
- name: catppuccin/tmux
|
||||
type: git
|
||||
tags: plugin
|
||||
opts:
|
||||
destination: ~/.tmux/plugins
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
set-environment -g TMUX_PLUGINS_DIR "$HOME/.tmux/plugins"
|
||||
|
||||
# remap prefix from 'C-b' to 'C-space'
|
||||
# unbind C-b
|
||||
# set-option -g prefix C-space
|
||||
@@ -54,4 +56,4 @@ if-shell "[[ -f ~/.config/tmux/local.tmux ]]" {
|
||||
source -F "#{d:current_file}/theme.tmux"
|
||||
|
||||
# NOTE Initialize TMUX plugin manager (keep this line at the very bottom of tmux conf)
|
||||
run '${ZPLUG_REPOS}/tmux-plugins/tpm/tpm'
|
||||
run '${TMUX_PLUGINS_DIR}/tpm/tpm'
|
||||
|
||||
@@ -4,4 +4,4 @@ set -gq "@catppuccin_${MODULE_NAME}_icon" " "
|
||||
set -gqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_blue}"
|
||||
set -gq "@catppuccin_${MODULE_NAME}_text" " %d-%m"
|
||||
|
||||
source "${ZPLUG_REPOS}/catppuccin/tmux/utils/status_module.conf"
|
||||
source "${TMUX_PLUGINS_DIR}/catppuccin/tmux/utils/status_module.conf"
|
||||
|
||||
@@ -4,4 +4,4 @@ set -gq "@catppuccin_${MODULE_NAME}_icon" " "
|
||||
set -gqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_blue}"
|
||||
set -gq "@catppuccin_${MODULE_NAME}_text" " #{=/-32/...:#{s|$USER|~|:#{b:pane_current_path}}}"
|
||||
|
||||
source "${ZPLUG_REPOS}/catppuccin/tmux/utils/status_module.conf"
|
||||
source "${TMUX_PLUGINS_DIR}/catppuccin/tmux/utils/status_module.conf"
|
||||
|
||||
@@ -11,4 +11,4 @@ set -gqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_mauve}"
|
||||
set -gqF "@catppuccin_${MODULE_NAME}_text" "#{?#{==:#{@on_stat},ok}, on, off}"
|
||||
# set -gqF "@catppuccin_${MODULE_NAME}_text" "#{online_status}"
|
||||
|
||||
source "${ZPLUG_REPOS}/catppuccin/tmux/utils/status_module.conf"
|
||||
source "${TMUX_PLUGINS_DIR}/catppuccin/tmux/utils/status_module.conf"
|
||||
|
||||
@@ -4,4 +4,4 @@ set -gq "@catppuccin_${MODULE_NAME}_icon" " "
|
||||
set -gqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_red}"
|
||||
set -gq "@catppuccin_${MODULE_NAME}_text" " #{pane_current_command}"
|
||||
|
||||
source "${ZPLUG_REPOS}/catppuccin/tmux/utils/status_module.conf"
|
||||
source "${TMUX_PLUGINS_DIR}/catppuccin/tmux/utils/status_module.conf"
|
||||
|
||||
@@ -4,4 +4,4 @@ set -gq "@catppuccin_${MODULE_NAME}_icon" " "
|
||||
set -gqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_blue}"
|
||||
set -gq "@catppuccin_${MODULE_NAME}_text" " %H:%M:%S"
|
||||
|
||||
source "${ZPLUG_REPOS}/catppuccin/tmux/utils/status_module.conf"
|
||||
source "${TMUX_PLUGINS_DIR}/catppuccin/tmux/utils/status_module.conf"
|
||||
|
||||
@@ -5,4 +5,4 @@ set -gqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_green}"
|
||||
# set -gqF "@catppuccin_${MODULE_NAME}_text" " #(df -h /System/Volumes/Data | awk 'NR==2{print $5}' | tr -d '\n')"
|
||||
set -gq "@catppuccin_${MODULE_NAME}_text" " #(echo -n test)"
|
||||
|
||||
source "${ZPLUG_REPOS}/catppuccin/tmux/utils/status_module.conf"
|
||||
source "${TMUX_PLUGINS_DIR}/catppuccin/tmux/utils/status_module.conf"
|
||||
|
||||
@@ -4,4 +4,4 @@ set -gq "@catppuccin_${MODULE_NAME}_icon" " "
|
||||
set -gqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_yellow}"
|
||||
set -gq "@catppuccin_${MODULE_NAME}_text" " zoom"
|
||||
|
||||
source "${ZPLUG_REPOS}/catppuccin/tmux/utils/status_module.conf"
|
||||
source "${TMUX_PLUGINS_DIR}/catppuccin/tmux/utils/status_module.conf"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
run "${ZPLUG_REPOS}/catppuccin/tmux/catppuccin.tmux"
|
||||
run "${TMUX_PLUGINS_DIR}/tmux/catppuccin.tmux"
|
||||
|
||||
source -F "#{d:current_file}/modules/date.tmux"
|
||||
source -F "#{d:current_file}/modules/dir.tmux"
|
||||
@@ -77,6 +77,6 @@ set -g window-status-bell-style "bg=#{@thm_red},fg=#{@thm_surface_0},bold"
|
||||
set -g window-status-current-format "#[reverse]#[noreverse]#I#{?#{!=:#{window_name},Window}, #W,}#[bg=#{@thm_surface_0},fg=#{@thm_rosewater}]"
|
||||
set -g window-status-current-style "bg=#{@thm_rosewater},fg=#{@thm_surface_0},bold"
|
||||
|
||||
run "${ZPLUG_REPOS}/tmux-plugins/tmux-online-status/online_status.tmux"
|
||||
run "${ZPLUG_REPOS}/tmux-plugins/tmux-battery/battery.tmux"
|
||||
run "${ZPLUG_REPOS}/tmux-plugins/tmux-cpu/cpu.tmux"
|
||||
run "${TMUX_PLUGINS_DIR}/tmux-online-status/online_status.tmux"
|
||||
run "${TMUX_PLUGINS_DIR}/tmux-battery/battery.tmux"
|
||||
run "${TMUX_PLUGINS_DIR}/tmux-cpu/cpu.tmux"
|
||||
|
||||
11
.zshrc
11
.zshrc
@@ -3,7 +3,16 @@ export CFG="$DOTFILES/.config"
|
||||
export DOTBIN="$HOME/.config/bin"
|
||||
export DOTBIN_META="$HOME/.config/.bin"
|
||||
|
||||
source "$DOTFILES/zplug.init.zsh"
|
||||
# Load sofmani-managed zsh plugins
|
||||
setopt +o nomatch
|
||||
for plugin in ~/.local/share/zsh/plugins/**/**/*.plugin.zsh; do
|
||||
[ -e "$plugin" ] && source "$plugin"
|
||||
done
|
||||
source ~/.local/share/zsh/plugins/powerlevel10k/powerlevel10k.zsh-theme
|
||||
setopt -o nomatch
|
||||
|
||||
wd() { . ~/.local/share/zsh/plugins/wd/wd.sh }
|
||||
|
||||
source "$DOTFILES/exports.zsh"
|
||||
|
||||
[[ "$1" == "-q" ]] || run-parts "$DOTFILES/plugins/motd"
|
||||
|
||||
@@ -15,7 +15,6 @@ Some notable tools I use are:
|
||||
- Nvim (`.config/nvim`)
|
||||
- Tmux (`.config/tmux`, `utils/tx`)
|
||||
- WezTerm (`.config/wezterm/wezterm.lua`)
|
||||
- Zplug (`zplug.init.sh`)
|
||||
|
||||
### Requirements
|
||||
|
||||
|
||||
@@ -9,6 +9,10 @@ export GITHUB_GPG_KEY_ID="B5690EEEBB952194"
|
||||
# local bin
|
||||
export PATH="$HOME/.local/bin:$HOME/bin:/usr/local/bin:/usr/local/sbin:$PATH"
|
||||
|
||||
# local plugins
|
||||
export PLUGINS_DIR="$HOME/.local/share/zsh/plugins"
|
||||
export TMUX_PLUGINS_DIR="$HOME/.tmux/plugins"
|
||||
|
||||
# Lazygit
|
||||
if [[ -d "$HOME/Library/ApplicationSupport/lazygit" ]]; then
|
||||
export LAZYGIT_HOME="$HOME/Library/ApplicationSupport/lazygit"
|
||||
|
||||
13
install.zsh
13
install.zsh
@@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
type src >/dev/null || source "$DOTFILES/zplug.init.zsh"
|
||||
echo_green "Preparing..."
|
||||
|
||||
# Source files
|
||||
@@ -16,9 +15,6 @@ set_git_configs=$(git config --global user.signingkey &>/dev/null && echo 0 || e
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
-z | --zplug)
|
||||
refresh_zplug=1
|
||||
;;
|
||||
-t | --tmux)
|
||||
refresh_tmux=1
|
||||
;;
|
||||
@@ -69,15 +65,6 @@ if [[ -z "$OPENAI_API_KEY" ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Zplug packages reload
|
||||
if [[ $refresh_zplug -eq 1 ]]; then
|
||||
echo_yellow "Reloading zplug..."
|
||||
zplug clear
|
||||
source "$DOTFILES/zplug.init.zsh"
|
||||
zplug install
|
||||
zplug load --verbose
|
||||
fi
|
||||
|
||||
echo_green "Done"
|
||||
|
||||
popd
|
||||
|
||||
@@ -22,73 +22,70 @@ function spinner() {
|
||||
# (that way it works for any locale as long as the font supports the characters)
|
||||
local LC_CTYPE=C
|
||||
|
||||
local pid=$1 # Process Id of the previous running command
|
||||
# Run the provided command in background
|
||||
"$@" &
|
||||
local pid=$! # Process Id of the previous running command
|
||||
|
||||
case $(($RANDOM % 12)) in
|
||||
0)
|
||||
local spin='⠁⠂⠄⡀⢀⠠⠐⠈'
|
||||
local charwidth=3
|
||||
;;
|
||||
1)
|
||||
local spin='-\|/'
|
||||
local charwidth=1
|
||||
;;
|
||||
2)
|
||||
local spin="▁▂▃▄▅▆▇█▇▆▅▄▃▂▁"
|
||||
local charwidth=3
|
||||
;;
|
||||
3)
|
||||
local spin="▉▊▋▌▍▎▏▎▍▌▋▊▉"
|
||||
local charwidth=3
|
||||
;;
|
||||
4)
|
||||
local spin='←↖↑↗→↘↓↙'
|
||||
local charwidth=3
|
||||
;;
|
||||
5)
|
||||
local spin='▖▘▝▗'
|
||||
local charwidth=3
|
||||
;;
|
||||
6)
|
||||
local spin='┤┘┴└├┌┬┐'
|
||||
local charwidth=3
|
||||
;;
|
||||
7)
|
||||
local spin='◢◣◤◥'
|
||||
local charwidth=3
|
||||
;;
|
||||
8)
|
||||
local spin='◰◳◲◱'
|
||||
local charwidth=3
|
||||
;;
|
||||
9)
|
||||
local spin='◴◷◶◵'
|
||||
local charwidth=3
|
||||
;;
|
||||
10)
|
||||
local spin='◐◓◑◒'
|
||||
local charwidth=3
|
||||
;;
|
||||
11)
|
||||
local spin='⣾⣽⣻⢿⡿⣟⣯⣷'
|
||||
local charwidth=3
|
||||
;;
|
||||
0)
|
||||
local spin='⠁⠂⠄⡀⢀⠠⠐⠈'
|
||||
local charwidth=3
|
||||
;;
|
||||
1)
|
||||
local spin='-\|/'
|
||||
local charwidth=1
|
||||
;;
|
||||
2)
|
||||
local spin="▁▂▃▄▅▆▇█▇▆▅▄▃▂▁"
|
||||
local charwidth=3
|
||||
;;
|
||||
3)
|
||||
local spin="▉▊▋▌▍▎▏▎▍▌▋▊▉"
|
||||
local charwidth=3
|
||||
;;
|
||||
4)
|
||||
local spin='←↖↑↗→↘↓↙'
|
||||
local charwidth=3
|
||||
;;
|
||||
5)
|
||||
local spin='▖▘▝▗'
|
||||
local charwidth=3
|
||||
;;
|
||||
6)
|
||||
local spin='┤┘┴└├┌┬┐'
|
||||
local charwidth=3
|
||||
;;
|
||||
7)
|
||||
local spin='◢◣◤◥'
|
||||
local charwidth=3
|
||||
;;
|
||||
8)
|
||||
local spin='◰◳◲◱'
|
||||
local charwidth=3
|
||||
;;
|
||||
9)
|
||||
local spin='◴◷◶◵'
|
||||
local charwidth=3
|
||||
;;
|
||||
10)
|
||||
local spin='◐◓◑◒'
|
||||
local charwidth=3
|
||||
;;
|
||||
11)
|
||||
local spin='⣾⣽⣻⢿⡿⣟⣯⣷'
|
||||
local charwidth=3
|
||||
;;
|
||||
esac
|
||||
|
||||
local i=0
|
||||
tput civis # cursor invisible
|
||||
while kill -0 $pid 2>/dev/null; do
|
||||
while kill -0 "$pid" 2>/dev/null; do
|
||||
local i=$(((i + $charwidth) % ${#spin}))
|
||||
printf "%s" "${spin:$i:$charwidth}"
|
||||
|
||||
cursorBack 1
|
||||
sleep .1
|
||||
done
|
||||
tput cnorm
|
||||
wait $pid # capture exit code
|
||||
wait "$pid" # capture exit code
|
||||
return $?
|
||||
}
|
||||
|
||||
("$@") &
|
||||
|
||||
spinner $!
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
source ~/.zplug/init.zsh
|
||||
|
||||
# Local
|
||||
zplug "$DOTFILES/plugins", from:local
|
||||
|
||||
# Remote
|
||||
zplug "chenasraf/git-open", at:master
|
||||
zplug "mfaerevaag/wd", as:command, use:"wd.sh", hook-load:"wd() { . $ZPLUG_REPOS/mfaerevaag/wd/wd.sh }"
|
||||
zplug "romkatv/powerlevel10k", as:theme, depth:1
|
||||
zplug "zsh-users/zsh-autosuggestions"
|
||||
|
||||
zplug "tmux-plugins/tpm", from:github, depth:1
|
||||
zplug "catppuccin/tmux", as:theme, depth:1
|
||||
zplug "tmux-plugins/tmux-online-status", depth:1
|
||||
zplug "tmux-plugins/tmux-battery", depth:1
|
||||
zplug "tmux-plugins/tmux-cpu", depth:1
|
||||
|
||||
zplug load
|
||||
|
||||
Reference in New Issue
Block a user