#!/bin/bash

# script to reload and refresh fluxbox 
# fehlix, 27. Aug 2020

# check apt-notifier is running
if pgrep -f 'python .*/usr/bin/apt-notifier.py' >/dev/null; then
   RUN_APT_NOTIFIER=true
   # we close apt-notifer now, to avoid systray artifacts
   pkill -f 'python .*/usr/bin/apt-notifier.py' 
   
else
   RUN_APT_NOTIFIER=false
fi
# restart fluxbox
fluxbox-remote restart
sleep 0.2

# restart idesk
idesktoggle idesk refresh
sleep 0.3

# restart apt-notifier in case it was running 
if [ "$RUN_APT_NOTIFIER" = "true" ]; then
   apt-notifier-unhide-Icon
fi

exit 0

