diff --git a/zsh/functions/btrfs-helpers.zsh b/zsh/functions/btrfs-helpers.zsh index abbd1d4..21ac512 100644 --- a/zsh/functions/btrfs-helpers.zsh +++ b/zsh/functions/btrfs-helpers.zsh @@ -58,8 +58,9 @@ _btrfs_check() { btrfs-usage() { _btrfs_check || return 1 local mount="${1:-$BTRFS_DEFAULT_MOUNT}" - - echo -e "${DF_BLUE}Btrfs Filesystem Usage: ${DF_YELLOW}${mount}${DF_NC}" + + df_print_func_header "Btrfs Filesystem Usage:" + #echo -e "${DF_BLUE}Btrfs Filesystem Usage: ${DF_YELLOW}${mount}${DF_NC}" echo "" sudo btrfs filesystem usage "$mount" -h @@ -70,7 +71,7 @@ btrfs-subs() { _btrfs_check || return 1 local mount="${1:-$BTRFS_DEFAULT_MOUNT}" - df_print_func_header "Btrfs Subvolumes" + df_print_func_name "Btrfs Subvolumes" #echo -e "${DF_BLUE}Btrfs Subvolumes" echo "" @@ -131,7 +132,7 @@ btrfs-balance-cancel() { btrfs-scrub() { _btrfs_check || return 1 local mount="${1:-$BTRFS_DEFAULT_MOUNT}" - df_print_func_header "Btrfs Scrub" + df_print_func_name "Btrfs Scrub" #echo -e "${DF_BLUE}Btrfs Scrub" echo "" @@ -212,7 +213,8 @@ btrfs-compress() { return 1 fi - echo -e "${DF_BLUE}Btrfs Compression Statistics${FD_NC}" + df_print_func_header "Btrfs Compression Statistics" + #echo -e "${DF_BLUE}Btrfs Compression Statistics${FD_NC}" echo "" sudo compsize "$target" @@ -226,7 +228,7 @@ btrfs-compress() { btrfs-info() { _btrfs_check || return 1 local mount="${1:-$BTRFS_DEFAULT_MOUNT}" - df_print_func_header "Btrfs Filesystem Info" + df_print_func_name "Btrfs Filesystem Information" #echo -e "${DF_BLUE}Btrfs Filesystem Information${DF_NC}" echo -e "\n${DF_CYAN}Filesystem Show:${DF_NC}" @@ -246,7 +248,7 @@ btrfs-health() { _btrfs_check || return 1 local mount="${1:-$BTRFS_DEFAULT_MOUNT}" - df_print_func_header "Btrfs Health Check" + df_print_func_name "Btrfs Health Check" #echo -e "${DF_BLUE}Btrfs Health Check${DF_NC}" echo "" @@ -319,7 +321,7 @@ btrfs-health() { btrfs-snap-usage() { _btrfs_check || return 1 - df_print_func_header "Snapshot Disc Usage" + df_print_func_name "Snapshot Disk Space Usage" #echo -e "${DF_BLUE}Snapshot Space Usage${DF_NC}" echo "" @@ -345,7 +347,7 @@ btrfs-maintain() { _btrfs_check || return 1 local mount="${1:-$BTRFS_DEFAULT_MOUNT}" - df_print_func_header "script-name" + df_print_func_name "Btrfs Maintenance Routine" #echo -e "${DF_BLUE}Btrfs Maintenance Routine${DF_NC}" echo "" echo "This will perform:" @@ -388,7 +390,7 @@ alias btrc='btrfs-compress' # ============================================================================ btrfs-help() { - df_print_func_header "Btrfs Helper CMD" + df_print_func_name "Btrfs Helper Commands" #echo -e "${DF_BLUE}Btrfs Helper Commands${DF_NC}" cat << 'EOF' diff --git a/zsh/lib/colors.zsh b/zsh/lib/colors.zsh index 85956ad..aa77300 100644 --- a/zsh/lib/colors.zsh +++ b/zsh/lib/colors.zsh @@ -110,11 +110,39 @@ df_print_section() { } # ============================================================================ -# MOTD-Style Header Function +# MOTD-Style Header/Function Header # ============================================================================ # Prints a standardized header box for scripts # Usage: df_print_header "script-name" +# Usage: df_print_func_name "func-name" + +df_print_func_name() { + local func_name="${1:-func}" + local datetime=$(date '+%a %b %d %H:%M') + local width=66 + + # Build horizontal line + local hline="" + for ((i=0; i