mirror of
https://github.com/stornic56/debianito-post-install.git
synced 2026-09-14 06:02:35 +00:00
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:
+37
-1
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user