30 lines
814 B
Bash
30 lines
814 B
Bash
#!/bin/bash
|
|
set -eo pipefail
|
|
|
|
# Nettoyage des anciens processus
|
|
pkill -f start-notification-service.py || true
|
|
rm -f /tmp/notify-service.pid
|
|
|
|
# Démarrage du bus D-Bus
|
|
echo "🚀 Initialisation du bus D-Bus..."
|
|
export DBUS_SESSION_BUS_ADDRESS="unix:path=/tmp/dbus-session"
|
|
dbus-daemon --session --address="$DBUS_SESSION_BUS_ADDRESS" --fork
|
|
sleep 1
|
|
|
|
# Démarrage du service
|
|
echo "🔧 Lancement du service..."
|
|
python3 start-notification-service.py &
|
|
SERVICE_PID=$!
|
|
echo $SERVICE_PID > /tmp/notify-service.pid
|
|
|
|
# Vérification
|
|
sleep 2
|
|
if ! gdbus introspect --session \
|
|
--dest org.freedesktop.Notifications \
|
|
--object-path /org/freedesktop/Notifications >/dev/null; then
|
|
echo "❌ Échec de l'enregistrement du service"
|
|
kill $SERVICE_PID
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ Service opérationnel (PID: $SERVICE_PID)" |