From 9ebf91e892cbafbf03d09f3adca652db181d1587 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Mon, 5 Aug 2024 19:30:47 -0400 Subject: Wayland migration (first of many) --- .local/bin/dwmbar/dwmb-battery | 2 +- .local/bin/dwmbar/dwmb-date | 5 ++++- .local/bin/dwmbar/dwmb-dotfiles | 2 +- .local/bin/dwmbar/dwmb-eselect | 12 +++++++----- .local/bin/dwmbar/dwmb-mail | 6 +++--- .local/bin/dwmbar/dwmb-time | 5 ++++- 6 files changed, 20 insertions(+), 12 deletions(-) (limited to '.local/bin/dwmbar') 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" + -- cgit v1.2.3