home
/
code
/
khatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ed46815
)
Bring back src module name in messages
author
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 29 Aug 2018 21:13:10 +0000
(17:13 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 29 Aug 2018 21:13:10 +0000
(17:13 -0400)
Makefile
patch
|
blob
|
blame
|
history
src/awk/exe/actuate_alert_to_notify_send.awk
patch
|
blob
|
blame
|
history
src/awk/exe/actuate_status_bar_to_xsetroot_name.awk
patch
|
blob
|
blame
|
history
src/awk/lib/msg_out.awk
patch
|
blob
|
blame
|
history
diff --git
a/Makefile
b/Makefile
index
f3c91d6
..
c741acf
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-24,6
+24,7
@@
AWK_EXECUTABLES := \
define BUILD_AWK_EXE
echo '#! $(PATH_TO_AWK) -f' > $@ && \
define BUILD_AWK_EXE
echo '#! $(PATH_TO_AWK) -f' > $@ && \
+ echo 'BEGIN {Module = "$(notdir $@)"}' >> $@ && \
cat $^ >> $@ && \
chmod +x $@
endef
cat $^ >> $@ && \
chmod +x $@
endef
@@
-32,7
+33,6
@@
endef
build \
clean
build \
clean
-
build: $(AWK_EXECUTABLES)
clean:
build: $(AWK_EXECUTABLES)
clean:
diff --git
a/src/awk/exe/actuate_alert_to_notify_send.awk
b/src/awk/exe/actuate_alert_to_notify_send.awk
index
eae5cb5
..
f11b2f4
100755
(executable)
--- a/
src/awk/exe/actuate_alert_to_notify_send.awk
+++ b/
src/awk/exe/actuate_alert_to_notify_send.awk
@@
-7,17
+7,20
@@
BEGIN {
}
$1 == "OK" && \
}
$1 == "OK" && \
-$2 == "alert" {
- priority = $3
- subject = $4
+$3 == "alert" {
+ src = $2
+ priority = $4
+ subject = $5
- # Not just using $
5
for body - because body might contain a character
+ # Not just using $
6
for body - because body might contain a character
# identical to FS
len_line = length($0)
len_head = length($1 FS $2 FS $3 FS $4 FS $5 FS)
len_body = len_line - len_head
body = substr($0, len_head + 1, len_body)
# identical to FS
len_line = length($0)
len_head = length($1 FS $2 FS $3 FS $4 FS $5 FS)
len_body = len_line - len_head
body = substr($0, len_head + 1, len_body)
+ sep = body ? "\n" : ""
+ body = body sep "--" src
urgency = priority
sub("hi" , "critical", urgency)
sub("med", "normal" , urgency)
urgency = priority
sub("hi" , "critical", urgency)
sub("med", "normal" , urgency)
diff --git
a/src/awk/exe/actuate_status_bar_to_xsetroot_name.awk
b/src/awk/exe/actuate_status_bar_to_xsetroot_name.awk
index
60966c3
..
b97538b
100755
(executable)
--- a/
src/awk/exe/actuate_status_bar_to_xsetroot_name.awk
+++ b/
src/awk/exe/actuate_status_bar_to_xsetroot_name.awk
@@
-7,7
+7,6
@@
$3 == "status_bar" {
len_head = length($1 FS $2 FS $3 FS)
len_val = len_line - len_head
val = substr($0, len_head + 1, len_val)
len_head = length($1 FS $2 FS $3 FS)
len_val = len_line - len_head
val = substr($0, len_head + 1, len_val)
-
system("xsetroot -name \"" val "\"")
next
}
system("xsetroot -name \"" val "\"")
next
}
diff --git
a/src/awk/lib/msg_out.awk
b/src/awk/lib/msg_out.awk
index
9207fd0
..
1a0f813
100755
(executable)
--- a/
src/awk/lib/msg_out.awk
+++ b/
src/awk/lib/msg_out.awk
@@
-16,5
+16,5
@@
function msg_out_error(location, msg) {
}
function msg_out(status, key, val, channel) {
}
function msg_out(status, key, val, channel) {
- print(status, key, val) > channel
+ print(status,
Module,
key, val) > channel
}
}
This page took
0.036887 seconds
and
4
git commands to generate.