home
/
code
/
khatus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Line-buffer upower output
[khatus.git]
/
bin
/
khatus_parse_bluetoothctl_show
diff --git
a/bin/khatus_parse_bluetoothctl_show
b/bin/khatus_parse_bluetoothctl_show
index
08a8708
..
0d56853
100755
(executable)
--- a/
bin/khatus_parse_bluetoothctl_show
+++ b/
bin/khatus_parse_bluetoothctl_show
@@
-1,5
+1,10
@@
#! /usr/bin/awk -f
#! /usr/bin/awk -f
+BEGIN {
+ OFS = msg_fs ? msg_fs : "|"
+ Kfs = key_fs ? key_fs : ":"
+}
+
/^Controller / {
controller = $2
controllers[++ctrl_count] = controller
/^Controller / {
controller = $2
controllers[++ctrl_count] = controller
@@
-8,7
+13,7
@@
/^\t[A-Z][A-Za-z]+:/ {
key = $1
sub(":$", "", key)
/^\t[A-Z][A-Za-z]+:/ {
key = $1
sub(":$", "", key)
- sub("^
" $1
, "")
+ sub("^
\t" $1 " *"
, "")
val = $0
data[controller, key] = val
}
val = $0
data[controller, key] = val
}
@@
-26,9
+31,9
@@
END {
show = "ERROR"
}
} else {
show = "ERROR"
}
} else {
- show = "
off" # TODO: Perhaps use differentiated marker?
+ show = "
n/a"
}
}
- print(show)
+ print(
"power_status",
show)
}
function print_error(msg) {
}
function print_error(msg) {
This page took
0.029623 seconds
and
4
git commands to generate.