Commented out some debug prints and fixed bug preventing to print when no monitor is specified

master
Meliurwen 2 years ago
parent 77bbc76066
commit d0fec9c00c
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 10
      .local/bin/acejuice

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

Loading…
Cancel
Save