Dotfiles update 2025-12-25 15:45

This commit is contained in:
Aaron D. Lee
2025-12-25 15:45:29 -05:00
parent c4ccb4150d
commit b1dc1877d1
17 changed files with 4437 additions and 243 deletions

58
machines/default.zsh Normal file
View File

@@ -0,0 +1,58 @@
# ============================================================================
# Default Machine Configuration
# ============================================================================
# This file is loaded on ALL machines before hostname-specific configs.
# Use it for settings that should be shared across all your machines.
#
# Load order:
# 1. dotfiles.conf (base config)
# 2. machines/default.zsh (this file)
# 3. machines/type-<type>.zsh (laptop, desktop, server, virtual)
# 4. machines/<hostname>.zsh (machine-specific)
# 5. ~/.zshrc.local (local overrides, not synced)
# ============================================================================
# ============================================================================
# Shared Settings
# ============================================================================
# Uncomment and modify settings you want on all machines
# --- Display ---
# DF_WIDTH="74"
# --- Features ---
# ENABLE_SMART_SUGGESTIONS="true"
# ENABLE_COMMAND_PALETTE="true"
# --- Notification Settings ---
# DF_NOTIFY_ENABLED="true"
# DF_NOTIFY_THRESHOLD="60"
# --- Project Environment ---
# DF_PROJECT_ENV_ENABLED="true"
# DF_PROJECT_AUTO_VENV="true"
# ============================================================================
# Shared Aliases
# ============================================================================
# Add aliases that should exist on all machines
# alias mycompany='cd ~/work/mycompany'
# ============================================================================
# Shared Environment
# ============================================================================
# Environment variables for all machines
# export EDITOR="nvim"
# export BROWSER="firefox"
# ============================================================================
# Shared Functions
# ============================================================================
# Functions available on all machines
# myfunction() {
# echo "This works everywhere"
# }

31
machines/type-laptop.zsh Normal file
View File

@@ -0,0 +1,31 @@
# ============================================================================
# Laptop Machine Type Configuration
# ============================================================================
# Loaded on machines detected as laptops (has battery).
# ============================================================================
# --- Power-aware settings ---
# Reduce resource usage on battery
# Shorter MOTD on laptops (faster)
# MOTD_STYLE="mini"
# --- Battery monitoring alias ---
alias battery='cat /sys/class/power_supply/BAT0/capacity 2>/dev/null && echo "%" || echo "No battery"'
alias power='cat /sys/class/power_supply/BAT0/status 2>/dev/null || echo "Unknown"'
# --- Brightness control (if available) ---
if command -v brightnessctl &>/dev/null; then
alias bright='brightnessctl set'
alias brightness='brightnessctl get'
fi
# --- WiFi helpers ---
if command -v nmcli &>/dev/null; then
alias wifi='nmcli device wifi list'
alias wifi-connect='nmcli device wifi connect'
fi
# --- Suspend/hibernate helpers ---
alias suspend='systemctl suspend'
alias hibernate='systemctl hibernate'

36
machines/type-server.zsh Normal file
View File

@@ -0,0 +1,36 @@
# ============================================================================
# Server Machine Type Configuration
# ============================================================================
# Loaded on machines detected as servers.
# ============================================================================
# --- Minimal MOTD (servers don't need fancy displays) ---
MOTD_STYLE="mini"
# --- Disable notifications (no desktop on servers) ---
DF_NOTIFY_ENABLED="false"
# --- Server monitoring aliases ---
alias ports='ss -tulpn'
alias listening='ss -tulpn | grep LISTEN'
alias connections='ss -tan | grep ESTAB | wc -l'
# --- Log watching ---
alias syslog='sudo tail -f /var/log/syslog 2>/dev/null || sudo journalctl -f'
alias authlog='sudo tail -f /var/log/auth.log 2>/dev/null || sudo journalctl -f -u sshd'
# --- Docker shortcuts (servers often run containers) ---
if command -v docker &>/dev/null; then
alias dstats='docker stats --no-stream'
alias dclean='docker system prune -af'
alias dlogs='docker logs -f'
fi
# --- Quick system checks ---
alias diskspace='df -h | grep -v tmpfs | grep -v loop'
alias meminfo='free -h'
alias cpuinfo='lscpu | grep -E "Model name|Socket|Core|Thread"'
# --- Security ---
alias failed-logins='sudo journalctl -u sshd | grep -i "failed\|invalid"'
alias active-users='who'