mirror of
https://github.com/dredx/prole.git
synced 2026-09-24 19:44:33 +00:00
- Ensure dashboard service doesn't create an ordering cycle with `multi-user.target`. - Verify service safely attaches to a virtual terminal (VT) and passes VT to Xorg. - Ensure no `su` usage by default in the service. - Validate script behavior for passing VT and `-keeptty` options to Xorg. chore(dashboard): update systemd unit to avoid VT conflicts and improve logging - Remove `After` and `Wants` directives for `multi-user.target` to prevent conflicts. - Add `TTYPath`, `StandardInput`, and related options for VT attachment. - Ensure `ExecStopPost` restores getty service for the dashboard VT. fix(dashboard): improve Xorg resolution and clean up script logic - Dynamically determine Xorg executable location in `dashboard.sh`. - Pass VT, display, and `-keeptty` to Xorg to improve script reliability. fix(mariadb): correct exFAT mount options for external storage - Avoid `chown` failures by setting root ownership with group access for `mysql`. - Update external mount options to `uid=0,gid=mysql,umask=0002`. cleanup(mariadb): remove unnecessary owner/group permissions from migration marker task
66 lines
1.8 KiB
Bash
66 lines
1.8 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
DASHBOARD_DISPLAY="${DASHBOARD_DISPLAY:-:0}"
|
|
DASHBOARD_VT="${DASHBOARD_VT:-1}"
|
|
|
|
XORG_BIN="${DASHBOARD_XORG_BIN:-}"
|
|
if [[ -z "$XORG_BIN" ]]; then
|
|
if command -v Xorg >/dev/null 2>&1; then
|
|
XORG_BIN="$(command -v Xorg)"
|
|
elif [[ -x /usr/lib/xorg/Xorg ]]; then
|
|
XORG_BIN=/usr/lib/xorg/Xorg
|
|
elif [[ -x /usr/bin/Xorg ]]; then
|
|
XORG_BIN=/usr/bin/Xorg
|
|
else
|
|
echo "dashboard.sh: Xorg not found in PATH and common locations" >&2
|
|
exit 127
|
|
fi
|
|
fi
|
|
|
|
# Create a temp conky config file
|
|
CFG="$(mktemp /tmp/conky-dashboard.XXXXXX.conf)"
|
|
cleanup() { rm -f "$CFG"; }
|
|
trap cleanup EXIT
|
|
|
|
cat >"$CFG" <<'EOF'
|
|
conky.config = {
|
|
update_interval = 1,
|
|
double_buffer = true,
|
|
background = false, -- foreground so Ctrl-C works
|
|
|
|
own_window = false, -- draw on root window
|
|
use_xft = true,
|
|
font = "DejaVu Sans Mono:size=16",
|
|
default_color = "AAAAAA",
|
|
|
|
alignment = "middle_middle",
|
|
gap_x = 0, gap_y = 0,
|
|
};
|
|
|
|
conky.text = [[
|
|
${font DejaVu Sans Mono:size=26}${color 777777}${nodename}${color}${font}
|
|
${color 666666}Uptime:${color} $uptime
|
|
${color 666666}Load:${color} $loadavg
|
|
|
|
${color 666666}CPU:${color} ${cpu}% ${color 444444}${cpubar 14,700}${color}
|
|
|
|
${color 666666}RAM:${color} $mem/$memmax ($memperc%) ${color 444444}${membar 14,700}${color}
|
|
|
|
${color 666666}Disk /:${color} ${fs_used /}/${fs_size /} ${color 444444}${fs_bar 14,700 /}${color}
|
|
|
|
${color 666666}Procs:${color} $processes ${color 666666}Running:${color} $running_processes
|
|
]];
|
|
EOF
|
|
|
|
# Start X just for this dashboard. Conky runs in the foreground; Ctrl-C exits X.
|
|
exec /usr/bin/xinit /usr/bin/env bash -lc '
|
|
# Disable screen blanking + power management
|
|
xset s off
|
|
xset -dpms
|
|
xset s noblank
|
|
|
|
xsetroot -solid "#202020"
|
|
exec conky -c "'"$CFG"'"
|
|
' -- "$XORG_BIN" "$DASHBOARD_DISPLAY" "vt${DASHBOARD_VT}" -keeptty -nolisten tcp
|