|
|
@ -1,5 +1,7 @@ |
|
|
|
#!/bin/sh |
|
|
|
#!/bin/sh |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set -e |
|
|
|
|
|
|
|
|
|
|
|
thrd_ctrl () { |
|
|
|
thrd_ctrl () { |
|
|
|
while true; do |
|
|
|
while true; do |
|
|
|
if ! kill -0 "$1" 2>/dev/null; then |
|
|
|
if ! kill -0 "$1" 2>/dev/null; then |
|
|
@ -56,6 +58,8 @@ _audio="..." |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__print_bar() { |
|
|
|
__print_bar() { |
|
|
|
|
|
|
|
# Print anyway even when the monitor is not specified |
|
|
|
|
|
|
|
[ ! -n "$_monitor_list" ] && printf "%%{l}%s%%{c}%s%%{r}%s %s %s %s" "$_workspaces" "$_date" "$_cputemp" "$_network" "$_audio" "$_battery" |
|
|
|
for _monitor_name in $_monitor_list; do |
|
|
|
for _monitor_name in $_monitor_list; do |
|
|
|
printf "%%{Sn%s}%%{l}%s%%{c}%s%%{r}%s %s %s %s" "$_monitor_name" "$_workspaces" "$_date" "$_cputemp" "$_network" "$_audio" "$_battery" |
|
|
|
printf "%%{Sn%s}%%{l}%s%%{c}%s%%{r}%s %s %s %s" "$_monitor_name" "$_workspaces" "$_date" "$_cputemp" "$_network" "$_audio" "$_battery" |
|
|
|
done |
|
|
|
done |
|
|
@ -63,13 +67,13 @@ __print_bar() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
msg_cmd_colon () { |
|
|
|
msg_cmd_colon () { |
|
|
|
printf "CMD: \"%s\"\nCONTENT: \"%s\"\n" "$1" "$2" |
|
|
|
#printf "CMD: \"%s\"\nCONTENT: \"%s\"\n" "$1" "$2" |
|
|
|
case "$1" in |
|
|
|
case "$1" in |
|
|
|
":SET") |
|
|
|
":SET") |
|
|
|
case "$2" in |
|
|
|
case "$2" in |
|
|
|
[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]" "*) |
|
|
|
[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]" "*) |
|
|
|
widget_content=${2##[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9] } |
|
|
|
widget_content=${2##[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9] } |
|
|
|
printf "WIDGET NAME: \"%s\"\nWIDGET CONTENT: \"%s\"\n" "${2% "$widget_content"}" "$widget_content" |
|
|
|
#printf "WIDGET NAME: \"%s\"\nWIDGET CONTENT: \"%s\"\n" "${2% "$widget_content"}" "$widget_content" |
|
|
|
case "${2% "$widget_content"}" in |
|
|
|
case "${2% "$widget_content"}" in |
|
|
|
"work") |
|
|
|
"work") |
|
|
|
_workspaces="${widget_content}" |
|
|
|
_workspaces="${widget_content}" |
|
|
@ -128,7 +132,7 @@ msg_cmd_colon () { |
|
|
|
case "$2" in |
|
|
|
case "$2" in |
|
|
|
"LIST "[A-Za-z0-9]*) |
|
|
|
"LIST "[A-Za-z0-9]*) |
|
|
|
_monitor_list=${2##LIST } |
|
|
|
_monitor_list=${2##LIST } |
|
|
|
printf "MONITOR LIST: \"%s\"\n" "$_monitor_list" |
|
|
|
#printf "MONITOR LIST: \"%s\"\n" "$_monitor_list" |
|
|
|
;; |
|
|
|
;; |
|
|
|
"ADD") |
|
|
|
"ADD") |
|
|
|
: |
|
|
|
: |
|
|
|