#!/bin/sh
set -eu

SRC="/etc/X11/fluxbox/fluxbox-menu"
UPD_SCRIPT="/opt/retrodebian/fluxbox/update-menu.sh"

# initial generate
"$UPD_SCRIPT"

inotifywait -m -e modify -e move_self -e close_write "$SRC" 2>/dev/null |
while read dummy; do
    "$UPD_SCRIPT"
done