#!/bin/bash
#=========================================#
# Simple update notifier (DNF) v0.3.9     #
#=========================================#
ICON="/usr/share/simple-notifier/icons/simple-notifier.png"
UPDATES=$(cat /var/tmp/.simple-notifier/num_updates)
if [ "$UPDATES" = "0" ]; then 
yad \
    --center \
    --title "Update Information" \
    --width=400 --height=100 --fixed \
    --window-icon="$ICON" \
    --image="$ICON" \
    --text="\nThere are no available updates at this time." \
    --button=OK!gtk-ok:1
if [ $? -eq 1 ]; then
    exit 0
fi
 fi
if [ "$UPDATES" -gt "0" ]; then
script_dir="$( cd "$( dirname "$0" )" && pwd )"
script="`basename $0`"
script_path_n_name="${script_dir}/${script}"
GUI_SU="pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY" 
$GUI_SU xterm -fa 'Monospace' -fs 10 -e /usr/share/simple-notifier/scripts/Simple-Updater-CLI; exit;
rm -f /var/tmp/.simple-notifier/num_updates
echo 0 > /var/tmp/.simple-notifier/num_updates
fi



