X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=bin%2Fkhatus_actuate_status_bar_to_xsetroot_name;h=f41cbd137e649077b96ccde9cecf3292e011768c;hb=e46c8cdd6749c2eac359d746e5aea0d890614362;hp=a7463e2c3450c7622374dc77e27824d372bb8da2;hpb=43e499034fbf9fddc79b8ee9168634cb4edc98bd;p=khatus.git diff --git a/bin/khatus_actuate_status_bar_to_xsetroot_name b/bin/khatus_actuate_status_bar_to_xsetroot_name index a7463e2..f41cbd1 100755 --- a/bin/khatus_actuate_status_bar_to_xsetroot_name +++ b/bin/khatus_actuate_status_bar_to_xsetroot_name @@ -1,8 +1,21 @@ #! /usr/bin/awk -f -/^STATUS_BAR / { - sub("^" $1 " +", "") - # TODO: Move padding back to controller, now that we no-longer use readline - system("xsetroot -name \" " $0 "\" ") +BEGIN { + FS = msg_fs ? msg_fs : "|" + OFS = msg_fs ? msg_fs : "|" + Kfs = key_fs ? key_fs : ":" +} + +$1 == "OK" && \ +$2 == "khatus_bar" && \ +$3 == "status_bar" { + # Not just using $4 for val - because val might contain a character + # identical to FS + len_line = length($0) + 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 }