Redesign message format
[khatus.git] / src / awk / exe / actuate_alert_to_notify_send.awk
1 BEGIN {
2 # Set the correct value as any other AWK variable:
3 #
4 # khatus_actuate_alert_to_notify_send -v Display="$CORRECT_DISPLAY"
5 #
6 Display = Display ? Display : ":0"
7 }
8
9
10
11 $3 == "alert" {
12 delete msg
13 msg_in_parse(msg, $0)
14 body = msg["body"]
15 sep = body ? "\n" : ""
16 body = body sep "--" msg["node"] ":" msg["module"]
17 urgency = msg["priority"]
18 sub("hi" , "critical", urgency)
19 sub("med", "normal" , urgency)
20
21 cmd = \
22 sprintf(\
23 "DISPLAY=%s notify-send -u %s %s \" %s\"",
24 Display, urgency, msg["subject"], body \
25 )
26 system(cmd)
27 next
28 }
This page took 0.06592 seconds and 4 git commands to generate.