diff options
author | Benjamin Chausse <benjamin@chausse.xyz> | 2024-08-05 19:30:47 -0400 |
---|---|---|
committer | Benjamin Chausse <benjamin@chausse.xyz> | 2024-08-05 19:30:47 -0400 |
commit | 9ebf91e892cbafbf03d09f3adca652db181d1587 (patch) | |
tree | 299f0a362d3ad0f7be8757c7b3cbd2ee715b65cc /.local/bin/dwmbar | |
parent | da5ef3b9e22e11192279f0becaa0c8c35b7ff929 (diff) |
Wayland migration (first of many)
Diffstat (limited to '.local/bin/dwmbar')
-rwxr-xr-x | .local/bin/dwmbar/dwmb-battery | 2 | ||||
-rwxr-xr-x | .local/bin/dwmbar/dwmb-date | 5 | ||||
-rwxr-xr-x | .local/bin/dwmbar/dwmb-dotfiles | 2 | ||||
-rwxr-xr-x | .local/bin/dwmbar/dwmb-eselect | 12 | ||||
-rwxr-xr-x | .local/bin/dwmbar/dwmb-mail | 6 | ||||
-rwxr-xr-x | .local/bin/dwmbar/dwmb-time | 5 |
6 files changed, 20 insertions, 12 deletions
diff --git a/.local/bin/dwmbar/dwmb-battery b/.local/bin/dwmbar/dwmb-battery index 38673ef..c888fd8 100755 --- a/.local/bin/dwmbar/dwmb-battery +++ b/.local/bin/dwmbar/dwmb-battery @@ -44,4 +44,4 @@ esac [8-9][0-9] | 100) icon=" " ;; esac -printf " %s%s%%" "$icon" "$capacity" +printf '{ "text": "%s%s%%", "class":"block"}\n' "$icon" "$capacity" diff --git a/.local/bin/dwmbar/dwmb-date b/.local/bin/dwmbar/dwmb-date index cd598b1..ece4e5f 100755 --- a/.local/bin/dwmbar/dwmb-date +++ b/.local/bin/dwmbar/dwmb-date @@ -1,3 +1,6 @@ #!/bin/sh -date +" %a %b %d" +text=$(date +" %a %b %d") + +printf '{ "text": "%s", "class": "block" }\n' "$text" + diff --git a/.local/bin/dwmbar/dwmb-dotfiles b/.local/bin/dwmbar/dwmb-dotfiles index 8485120..7d43cce 100755 --- a/.local/bin/dwmbar/dwmb-dotfiles +++ b/.local/bin/dwmbar/dwmb-dotfiles @@ -22,4 +22,4 @@ status=$(yadm status --porcelain 2>/dev/null) [ -z "$status" ] && exit 0 -printf " " +printf '{"text": "", "class":"block"}\n' diff --git a/.local/bin/dwmbar/dwmb-eselect b/.local/bin/dwmbar/dwmb-eselect index 24372b4..1a51bd2 100755 --- a/.local/bin/dwmbar/dwmb-eselect +++ b/.local/bin/dwmbar/dwmb-eselect @@ -1,11 +1,13 @@ #!/bin/sh -icon=" " +icon="" total="$(eselect news count all)" unread="$(eselect news count new)" -case "$total" in -0) echo "" ;; -*) echo "$icon $unread/$total " ;; -esac +# case "$total" in +# 0) echo "" ;; +# *) printf '{"text":"%s %s/%s", "class":"block" }' "$icon" "$unread" "$total" ;; +# esac +# +printf '{"text":"%s %s/%s", "class":"block" }' "$icon" "$unread" "$total" diff --git a/.local/bin/dwmbar/dwmb-mail b/.local/bin/dwmbar/dwmb-mail index 4170c61..92324c6 100755 --- a/.local/bin/dwmbar/dwmb-mail +++ b/.local/bin/dwmbar/dwmb-mail @@ -5,6 +5,6 @@ unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/*/new/* -type f | wc -l 2>/dev/null)" -pidof mbsync >/dev/null 2>&1 && icon=" " - -[ "$unread" = "0" ] && [ "$icon" = "" ] || echo " $unread$icon " +# [ "$unread" = "0" ] && [ "$icon" = "" ] || echo " $unread" +# +[ "$unread" = "0" ] && [ "$icon" = "" ] || printf '{"text":" %s", "class":"block"}\n' "$unread" diff --git a/.local/bin/dwmbar/dwmb-time b/.local/bin/dwmbar/dwmb-time index bbd6585..15046a3 100755 --- a/.local/bin/dwmbar/dwmb-time +++ b/.local/bin/dwmbar/dwmb-time @@ -1,3 +1,6 @@ #!/bin/sh -date +" %H:%M " +text="$(date +" %H:%M")" + +printf '{ "text": "%s", "class": "block" }\n' "$text" + |