Dotfiles update 2025-12-24 19:22
This commit is contained in:
@@ -20,14 +20,14 @@ source "$DOTFILES_DIR/zsh/lib/colors.zsh" 2>/dev/null || {
|
|||||||
|
|
||||||
print_header() {
|
print_header() {
|
||||||
if declare -f df_print_header &>/dev/null; then
|
if declare -f df_print_header &>/dev/null; then
|
||||||
df_print_header "dotfiles-compile"
|
df_print_header "dotfiles-compile "
|
||||||
else
|
else
|
||||||
local user="${USER:-root}"
|
local user="${USER:-root}"
|
||||||
local hostname="${HOST:-$(hostname -s 2>/dev/null)}"
|
local hostname="${HOST:-$(hostname -s 2>/dev/null)}"
|
||||||
local datetime=$(date '+%a %b %d %H:%M')
|
local datetime=$(date '+%a %b %d %H:%M')
|
||||||
local width=66
|
local width=66
|
||||||
local hline="" && for ((i=0; i<width; i++)); do hline+="═"; done
|
local hline="" && for ((i=0; i<width; i++)); do hline+="═"; done
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "${DF_GREY}╒${hline}╕${DF_NC}"
|
echo "${DF_GREY}╒${hline}╕${DF_NC}"
|
||||||
echo "${DF_GREY}│${DF_NC} ${DF_BOLD}${DF_LIGHT_BLUE}✦ ${user}@${hostname}${DF_NC} ${DF_DIM}dotfiles-compile${DF_NC} ${datetime} ${DF_GREY}│${DF_NC}"
|
echo "${DF_GREY}│${DF_NC} ${DF_BOLD}${DF_LIGHT_BLUE}✦ ${user}@${hostname}${DF_NC} ${DF_DIM}dotfiles-compile${DF_NC} ${datetime} ${DF_GREY}│${DF_NC}"
|
||||||
@@ -51,48 +51,48 @@ compile_file() {
|
|||||||
|
|
||||||
clean_compiled() {
|
clean_compiled() {
|
||||||
echo "Removing compiled files..."
|
echo "Removing compiled files..."
|
||||||
|
|
||||||
local count=0
|
local count=0
|
||||||
|
|
||||||
for zwc in "$DOTFILES_DIR"/**/*.zwc(N); do
|
for zwc in "$DOTFILES_DIR"/**/*.zwc(N); do
|
||||||
rm -f "$zwc"
|
rm -f "$zwc"
|
||||||
((count++))
|
((count++))
|
||||||
done
|
done
|
||||||
|
|
||||||
rm -f ~/.zshrc.zwc ~/.zshenv.zwc ~/.zprofile.zwc 2>/dev/null
|
rm -f ~/.zshrc.zwc ~/.zshenv.zwc ~/.zprofile.zwc 2>/dev/null
|
||||||
|
|
||||||
echo -e "${DF_GREEN}✓${DF_NC} Removed $count compiled files"
|
echo -e "${DF_GREEN}✓${DF_NC} Removed $count compiled files"
|
||||||
}
|
}
|
||||||
|
|
||||||
compile_all() {
|
compile_all() {
|
||||||
echo -e "${DF_CYAN}Compiling zsh files for faster startup...${DF_NC}"
|
echo -e "${DF_CYAN}Compiling zsh files for faster startup...${DF_NC}"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo "Core files:"
|
echo "Core files:"
|
||||||
compile_file ~/.zshrc
|
compile_file ~/.zshrc
|
||||||
compile_file ~/.zshenv
|
compile_file ~/.zshenv
|
||||||
compile_file ~/.zprofile
|
compile_file ~/.zprofile
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo "Dotfiles:"
|
echo "Dotfiles:"
|
||||||
compile_file "$DOTFILES_DIR/zsh/.zshrc"
|
compile_file "$DOTFILES_DIR/zsh/.zshrc"
|
||||||
compile_file "$DOTFILES_DIR/zsh/aliases.zsh"
|
compile_file "$DOTFILES_DIR/zsh/aliases.zsh"
|
||||||
|
|
||||||
for file in "$DOTFILES_DIR/zsh/functions"/*.zsh(N); do
|
for file in "$DOTFILES_DIR/zsh/functions"/*.zsh(N); do
|
||||||
compile_file "$file"
|
compile_file "$file"
|
||||||
done
|
done
|
||||||
|
|
||||||
for file in "$DOTFILES_DIR/zsh/themes"/*.zsh-theme(N); do
|
for file in "$DOTFILES_DIR/zsh/themes"/*.zsh-theme(N); do
|
||||||
compile_file "$file"
|
compile_file "$file"
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if [[ -d ~/.oh-my-zsh ]]; then
|
if [[ -d ~/.oh-my-zsh ]]; then
|
||||||
echo "Oh-My-Zsh (optional):"
|
echo "Oh-My-Zsh (optional):"
|
||||||
compile_file ~/.oh-my-zsh/oh-my-zsh.sh
|
compile_file ~/.oh-my-zsh/oh-my-zsh.sh
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${DF_GREEN}✓${DF_NC} Compilation complete"
|
echo -e "${DF_GREEN}✓${DF_NC} Compilation complete"
|
||||||
echo
|
echo
|
||||||
echo "To measure startup time:"
|
echo "To measure startup time:"
|
||||||
|
|||||||
Reference in New Issue
Block a user