Linux Benachrichtigungsmeldung
5. Januar 2014
Manchmal dauern Aufgaben etwas länger auch wenn sie nicht die Volle Ressourcen nutzen bzw. welche die Extern sind. Also arbeitet man währenddessen weiter und muss immer wieder nach schauen bis es zu Ende ist. Abhilfe schafft die Notification. Die Installation erfolgt schlicht weg, per Apt-Get. [sourcecode lang=”bash”] sudo apt-get install notify-osd [/sourcecode] Eine Simple Ausgabe. […]

Manchmal dauern Aufgaben etwas länger auch wenn sie nicht die Volle Ressourcen nutzen bzw. welche die Extern sind.
Also arbeitet man währenddessen weiter und muss immer wieder nach schauen bis es zu Ende ist.
Abhilfe schafft die Notification.
Die Installation erfolgt schlicht weg, per Apt-Get.
[sourcecode lang="bash"]
sudo apt-get install notify-osd
[/sourcecode]
Eine Simple Ausgabe.
[sourcecode lang="bash"]
notify-send TITELZEILE "MELDUNG"
[/sourcecode]
Es gibt auch weitere Einstellungsmöglichkeiten.
-u, --urgency=LEVEL Zeigt die Wichtigkeit (trivial, normal, kritisch). -t, --expire-time=TIME Gibt ein Timeout aus, wann die Meldung abgelaufen ist. -i, --icon=ICON[,ICON...] Spezifiziert ein Icon. -c, --category=TYPE[,TYPE...] Stellt die Kategorie ein. -h, --hint=TYPE:NAME:VALUE Gibt den Datentyp an. -v, --version Version des Pakets.Einige Beispiele 1. Einfache Basis Meldung mit Icon, Title für 5000 Millisekunden. [sourcecode lang="bash"] notify-send "Message Title" "The message body is shown here" -i /usr/share/pixmaps/idle.xpm -t 5000 [/sourcecode] 2. Zeigt den Inhalt einer Datei: [sourcecode lang="bash"] notify-send test "`tail /var/log/syslog`" [/sourcecode] 3. Folgt einer Log Datei bzw. Aktualisierungen: [sourcecode lang="bash"] tail -n0 -f /var/log/messages | while read line; do notify-send "System Message" "$line"; done [/sourcecode] 4. Formattierungen mit HTML: [sourcecode lang="bash"] notify-send Test "<font size=16 color=blue><b><i>Hello World</b></i></font>" [/sourcecode]
Kommentare
Kommentare werden geladen...