Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
kmail & skript & led ansteuern
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
hug0
Guru
Guru


Joined: 02 Mar 2004
Posts: 303

PostPosted: Fri Oct 01, 2004 7:50 pm    Post subject: kmail & skript & led ansteuern Reply with quote

hallo!
kann ich irgendwie auf shell ebene rausfinden, ob ich eine neue mail - abgerufen von kmail - habe?
(würde draufhin gerne eine led zum leuchten bringen und die irgendwo einbauen :))


Last edited by hug0 on Wed Feb 09, 2005 8:49 pm; edited 3 times in total
Back to top
View user's profile Send private message
Aldo
Guru
Guru


Joined: 15 Jan 2003
Posts: 440
Location: Cologne, Germany

PostPosted: Fri Oct 01, 2004 8:16 pm    Post subject: Re: kmail Reply with quote

Schau dir mal Superkaramba an.
Ich habe damit eine Ausgabe auf dem Desktop ob und wieviele Mails ich bekommen habe.
Durch anpassen des Scripts läßt sich besimmt auch eine LED ansteuern.

Siehe Screenshot rechts unten.
http://aldomania.de.vu/pics/screenshots/snap.jpg

P.S. Das POP3-Script habe ich von der Jollix-CD übernommen und angepaßt.
_________________
Abit A-N78-HD
Phenom 9750
8 GB Ram
Linux 2.6.29-gentoo
FreeBSD 7.2
Back to top
View user's profile Send private message
hug0
Guru
Guru


Joined: 02 Mar 2004
Posts: 303

PostPosted: Fri Oct 01, 2004 8:34 pm    Post subject: Reply with quote

klingt schon mal gut! wäre es möglich, mir das theme oder auch nur die zeile zu posten oder mit per pm zu schicken? hab zwar ein theme gerade probiert, aber das funktioniert nicht so wirklich bei mir
Code:
dcop kmail default checkMail; sleep 5; echo 'You have ' | tr -d '\n'; dcopkmail KMailIface getFolder /inbox > /dev/null; dcop 'DCOPRef(kmail,FolderIface)' unreadMessages | tr -d '\n'; echo ' new e-mail messages'

danke!

EDIT: ops, es geht, lag an dem fehlenden leerzeichen zw dcop und kmail! thx!
Back to top
View user's profile Send private message
hug0
Guru
Guru


Joined: 02 Mar 2004
Posts: 303

PostPosted: Wed Feb 09, 2005 8:48 pm    Post subject: Reply with quote

ok, als normales shell skript funktioniert es, aber nicht, wenn ich dieses skript in crontab aufrufe.
hier nochmal das skript:
Code:
dcop kmail KMailIface getFolder /inbox > /dev/null;
dcop 'DCOPRef(kmail,FolderIface)' unreadMessages | tr -d '\n' > /home/florian/mails;


die datei "mails" wird zwar angelegt, aber ohne inhalt. denke wohl, dass es an den pfaden oder so liegt, aber auch der richtige pfad zu dcop hilft nicht weiter.
bin leider extrem unfit im scripting! danke!

EDIT und wenn wir schon beim skripten sind:
wie kann ich überprüfen, ob der inhalt der datei "mails" größer 0 ist?
Back to top
View user's profile Send private message
flo_02_mu
n00b
n00b


Joined: 06 Aug 2004
Posts: 73

PostPosted: Wed Feb 09, 2005 10:27 pm    Post subject: Reply with quote

hug0 wrote:

EDIT und wenn wir schon beim skripten sind:
wie kann ich überprüfen, ob der inhalt der datei "mails" größer 0 ist?


Aus man test:
Code:
-s FILE
              FILE exists and has a size greater than zero


Flo
Back to top
View user's profile Send private message
hug0
Guru
Guru


Joined: 02 Mar 2004
Posts: 303

PostPosted: Wed Feb 09, 2005 10:32 pm    Post subject: Reply with quote

hm, danke, aber ich möchte ja den inhalt überprüfen (0 mails oder >0 mails) und sobald auch nur die 0 in dem file steht ist natürlich auch die größe ungleich null.
Back to top
View user's profile Send private message
c07
Veteran
Veteran


Joined: 25 Oct 2002
Posts: 1091

PostPosted: Thu Feb 10, 2005 12:01 am    Post subject: Reply with quote

Wenn nur die Zahl selbst drinsteht mit [[ `cat file` != 0 ]] oder (( `cat file` > 0 )), siehe "man bash".
Back to top
View user's profile Send private message
hug0
Guru
Guru


Joined: 02 Mar 2004
Posts: 303

PostPosted: Thu Feb 10, 2005 7:59 am    Post subject: Reply with quote

ah, doch so einfach, danke!

bleibt nur noch die frage, warum der code
Code:
/usr/kde/3.3/bin/dcop kmail KMailIface getFolder /inbox > /dev/null;
/usr/kde/3.3/bin/dcop 'DCOPRef(kmail,FolderIface)' unreadMessages | tr -d '\n' > /home/florian/mails;

per hand funktioniert, aber nicht per crontab?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum