Dotfiles update 2025-12-24 23:39

This commit is contained in:
Aaron D. Lee
2025-12-24 23:39:57 -05:00
parent b514968de3
commit 4eb9be42d7

View File

@@ -322,9 +322,8 @@ btrfs-snap-usage() {
if [[ -d "/.snapshots" ]]; then if [[ -d "/.snapshots" ]]; then
echo -e "${DF_CYAN}Snapshot Directory:${DF_NC}" echo -e "${DF_CYAN}Snapshot Directory:${DF_NC}"
# Use timeout to prevent hanging, and run in background with wait
local size local size
size=$(timeout 10 sudo du -sh /.snapshots 2>/dev/null | cut -f1) size=$(sudo du -sh /.snapshots 2>/dev/null | cut -f1)
if [[ -n "$size" ]]; then if [[ -n "$size" ]]; then
echo " $size" echo " $size"
else else
@@ -333,7 +332,7 @@ btrfs-snap-usage() {
echo -e "\n${DF_CYAN}Individual Snapshots (top 10 by size):${DF_NC}" echo -e "\n${DF_CYAN}Individual Snapshots (top 10 by size):${DF_NC}"
# List snapshots with timeout protection # List snapshots with timeout protection
timeout 30 sudo du -sh /.snapshots/*/ 2>/dev/null | sort -h | tail -10 | sed 's/^/ /' || \ sudo du -sh /.snapshots/*/ 2>/dev/null | sort -h | tail -10 | sed 's/^/ /' || \
echo " Unable to list snapshots" echo " Unable to list snapshots"
else else
echo -e "${DF_YELLOW}${DF_NC} No /.snapshots directory found" echo -e "${DF_YELLOW}${DF_NC} No /.snapshots directory found"