Prevent duplicate X11 session loops from killing Conky and daemonize Conky cleanly

This commit is contained in:
Luxferre
2026-10-25 16:18:43 +02:00
parent 651720b56b
commit 0aff8a3379
5 changed files with 24 additions and 10 deletions
@@ -89,7 +89,7 @@ if [ -z "$SXMO_NO_MODEM" ] && command -v ModemManager > /dev/null; then
fi
# Start the desktop widget (e.g. clock)
pidof -s conky >/dev/null 2>&1 || (DISPLAY=:0 CONKY_DPY=:0 setsid conky -c /home/user/.config/sxmo/conky.conf >/dev/null 2>&1 </dev/null &)
pidof -s conky >/dev/null 2>&1 || DISPLAY=:0 CONKY_DPY=:0 conky -c /home/user/.config/sxmo/conky.conf -d >/dev/null 2>&1 </dev/null || true
# Monitor the battery
superctl start sxmo_battery_monitor
@@ -26,10 +26,8 @@ restart_conky() {
pkill -x conky >/dev/null 2>&1 || true
sleep 0.05
pkill -9 -x conky >/dev/null 2>&1 || true
(
DISPLAY="${DISPLAY:-:0}" CONKY_DPY="${DISPLAY:-:0}" \
setsid conky -c "${XDG_CONFIG_HOME:-/home/user/.config}/sxmo/conky.conf" >/dev/null 2>&1 </dev/null &
)
DISPLAY="${DISPLAY:-:0}" CONKY_DPY="${DISPLAY:-:0}" \
conky -c "${XDG_CONFIG_HOME:-/home/user/.config}/sxmo/conky.conf" -d >/dev/null 2>&1 </dev/null || true
rmdir "$lockdir" 2>/dev/null || true
}