[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdepim-users
Subject:    [kdepim-users] A dcop call to know wether and/or how many mails
From:       christophe <christophe.dr () free ! fr>
Date:       2007-04-03 22:31:50
Message-ID: 200704040031.58029.christophe.dr () free ! fr
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On an asus w1n laptop, i use the following script to blink a led when there is 
mail in kmail :

-------------------------------------------------------------------
#!/bin/sh
# blinks the mail led if a mail is received by kmail on asus W1N 

isThereMail=1
while [ $isThereMail -gt 0 ]; do
        count=30
        while [ $count -gt 0 ]; do
                echo 0 > /proc/acpi/asus/mled
                sleep 1
                echo 1 > /proc/acpi/asus/mled
                sleep 1
                count=$[$count - 1]
                echo $count
        done
        isThereMail=0
        touch numberOfMail
        dcop kmail KMailIface folderList | while read folder; do
                if [ "$folder" = "/Local" ]
                then
                        numberOfM=0
                        echo 0 > numberOfMail
                else
                        numberInFolder=$(dcop $(dcop kmail KMailIface 
getFolder "$folder") 
unreadMessages )
                        numberOfM=$[$numberOfM + $numberInFolder]
                        if [ $numberOfM > 0 ]
                        then
                                echo $numberOfM > numberOfMail
                        fi
                fi
        done
        isThereMail=$(cat numberOfMail)
        rm -f numberOfMail
        if [ $isThereMail -eq 0 ]
        then
                echo 0 > /proc/acpi/asus/mled
                IsThereMail=0 # exit
        fi
done
-------------------------------------------------------------------


The problem is that it occupies 100% cpu during about 2 seconds every minute 
to check if there is mail on kmail. Ideally i would like to use an integrated 
kmail dcop call.
Is there such call ?

I have also read on some ohter mailing lists that some people are doing such 
test :
if [ $`awk '$KDEHOME/share/apps/kmail/mail' .inbox.index | grep -c "0000″` = 
0 ]
Is it correct ?

Thanks.

-- 
christophe

[Attachment #5 (application/pgp-signature)]

_______________________________________________
KDE PIM users mailing list
kdepim-users@kde.org
https://mail.kde.org/mailman/listinfo/kdepim-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic