Skip to content

Commit

Permalink
fix notification daemons race in sway
Browse files Browse the repository at this point in the history
  • Loading branch information
fspv committed Oct 20, 2024
1 parent d7213c4 commit 6eb7f1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .config/sway/config
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ exec_always pkill -f window-bound-layout
exec_always $log ${HOME}/.config/sway/scripts/window-bound-layout.sh

exec_always pkill -f dunst
# xfce4-notifyd is started by dbus by default causing a race condition
exec_always $log systemctl --user stop xfce4-notifyd
exec_always $log dunst -layer overlay -config ${HOME}/.dunstrc

exec_always {
Expand Down
6 changes: 3 additions & 3 deletions .config/sway/scripts/log_wrapper.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/sh -ue

COMMAND=$(printf ' %q' "$@")
_NAME=$(basename $1)
_NAME=$(basename "$1")
APP=${_NAME%.*}

USER_TMP_DIR="/run/user/$(id -u)/sway_log"
mkdir -p ${USER_TMP_DIR}
mkdir -p "${USER_TMP_DIR}"

LOG=${USER_TMP_DIR}/${APP}.log

echo "[log_wrapper] Running ${COMMAND}, output log to ${LOG}"

sh -c "${COMMAND}" >> ${LOG} 2>&1 || echo "[log_wrapper] App terminated ${COMMAND}, see log ${LOG}"
sh -xc "${COMMAND}" >> "${LOG}" 2>&1 || echo "[log_wrapper] App terminated ${COMMAND}, see log ${LOG}"

0 comments on commit 6eb7f1c

Please sign in to comment.