Thanks! Now it's working...
~/.kde/Autostart/xhost.sh
~/bin/up_fetchmail.sh
Code:
#!/bin/sh
while : ; do
if fetchmail -a --fetchmailrc /etc/fetchmailrc 2> /dev/null | grep flushed > /dev/null
then
play /home/tiago/bin/notify.wav &
chown tiago.users /home/tiago/Mail/inbox/new/* &
chmod 777 /home/tiago/Mail/inbox/new/* &
su tiago -c /home/tiago/bin/dialogo-mutt.sh
fi
done
~/bin/dialogo-mutt.sh
Code:
#!/bin/bash
if [ -z "$DISPLAY" ]; then
dialog=/bin/dialog
else
dialog=/opt/kde/bin/kdialog
fi
$dialog --yesno "`date`\nVocê tem `ls /home/tiago/Mail/inbox/new/ | wc -l` novo(s) e-mail(s).\n\nDeseja abrir o Mutt?" 0 0
if [ $? = 0 ]; then
if [ "$dialog" = "/bin/dialog" ]; then
mutt
else
aterm +sb -T "Mutt for Tiago Madeira" -fn nada -e mutt
fi
fi
Now I got only another problem... if I'm not in graphic mode, I want that /bin/dialog does the dialogs (line 2-4, dialogo-mutt.sh) and mutt opens without terminal (line 10-12, dialogo-mutt.sh). Can I do that?
Thanks...