zram menu refactor, mesa fix & sysinfo ui

- Refactored `install_zram` into a dedicated submenu (`zram_menu`) within `modules/zram.sh`. Split monolithic logic into three distinct operations: `_zram_view`, `_zram_create`, and `_zram_remove`. Enables status verification before installation and safe cleanup. Updated main menu entry in `debianito.sh` to call the new sub-menu.
- Resolved Trixie backports dependency conflicts between `mesa-libgallium` and `mesa-va-drivers` (Mesa 26+). Modified package lists in `_helpers.sh` and `gpu.sh` to exclude `mesa-va-drivers` during backports installs, prioritizing `mesa-vulkan-drivers` for stable Gallium integration.
- Implemented dynamic dimensioning in `_show_sysinfo()`. Calculates optimal width/height based on terminal size (`tput cols`) and content length. Truncates long lines to prevent UI overflow in small terminals, capped at 22-line height.
This commit is contained in:
stornic56
2026-07-21 00:58:00 -05:00
committed by GitHub
parent 92d0eb7467
commit da88e9fcee
5 changed files with 156 additions and 9 deletions
+37 -1
View File
@@ -200,5 +200,41 @@ _show_sysinfo() {
fi
fi
_msg "System Information" "$msg" 22 76
# ════════════════════════════════════════════════════════════
# Dynamic dimension calculation
# ════════════════════════════════════════════════════════════
local term_cols
term_cols=$(tput cols 2>/dev/null || echo 80)
[ "$term_cols" -lt 50 ] && term_cols=50
local max_pct=$(( term_cols * 95 / 100 ))
[ "$max_pct" -lt 50 ] && max_pct=50
local longest=0
while IFS= read -r line; do
local len=${#line}
[ "$len" -gt "$longest" ] && longest=$len
done < <(echo -e "$msg")
local width=$(( longest + 6 ))
[ "$width" -lt 80 ] && width=80
[ "$width" -gt "$max_pct" ] && width=$max_pct
local truncated=""
while IFS= read -r line; do
if [ ${#line} -gt "$width" ]; then
truncated+="${line:0:$((width - 4))}...\\n"
else
truncated+="${line}\\n"
fi
done < <(echo -e "$msg")
local lines
lines=$(echo -e "$truncated" | wc -l)
local height=$(( lines + 6 ))
[ "$height" -gt 22 ] && height=22
[ "$height" -lt 10 ] && height=10
_msg "System Information" "$truncated" "$height" "$width"
}