fix: ensure log dir exists and show daemon PID in AppRun
This commit is contained in:
parent
666f1b400e
commit
82f7c5da9b
1 changed files with 5 additions and 1 deletions
|
|
@ -208,8 +208,10 @@ fi
|
||||||
if [ -z "$NEED_ROOT" ]; then
|
if [ -z "$NEED_ROOT" ]; then
|
||||||
# X11: no root needed
|
# X11: no root needed
|
||||||
pkill -x vietc 2>/dev/null; sleep 0.3
|
pkill -x vietc 2>/dev/null; sleep 0.3
|
||||||
|
mkdir -p "$HOME/.config/vietc"
|
||||||
"$HERE/usr/bin/vietc" >"$HOME/.config/vietc/vietc-daemon.log" 2>&1 &
|
"$HERE/usr/bin/vietc" >"$HOME/.config/vietc/vietc-daemon.log" 2>&1 &
|
||||||
DAEMON_PID=$!
|
DAEMON_PID=$!
|
||||||
|
echo "[vietc] Daemon started (PID=$DAEMON_PID), log: $HOME/.config/vietc/vietc-daemon.log"
|
||||||
else
|
else
|
||||||
# Fix Wayland env for root: sudo resets XDG_RUNTIME_DIR, breaking wtype/wl-copy.
|
# Fix Wayland env for root: sudo resets XDG_RUNTIME_DIR, breaking wtype/wl-copy.
|
||||||
if [ "$(id -u)" = "0" ] && [ -z "$XDG_RUNTIME_DIR" ] && [ -n "$SUDO_USER" ]; then
|
if [ "$(id -u)" = "0" ] && [ -z "$XDG_RUNTIME_DIR" ] && [ -n "$SUDO_USER" ]; then
|
||||||
|
|
@ -246,8 +248,10 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$DAEMON_PID" ] && ! pgrep -x vietc >/dev/null; then
|
if [ -z "$DAEMON_PID" ] && ! pgrep -x vietc >/dev/null; then
|
||||||
"$HERE/usr/bin/vietc" >/dev/null &
|
mkdir -p "$HOME/.config/vietc"
|
||||||
|
"$HERE/usr/bin/vietc" >"$HOME/.config/vietc/vietc-daemon.log" 2>&1 &
|
||||||
DAEMON_PID=$!
|
DAEMON_PID=$!
|
||||||
|
echo "[vietc] Daemon fallback started (PID=$DAEMON_PID), log: $HOME/.config/vietc/vietc-daemon.log"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Keep the AppImage alive with a tray or settings UI.
|
# Keep the AppImage alive with a tray or settings UI.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue