From ee01830c33c7b0f0e8d4f45f5cd96f7bc04a8efd Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Fri, 29 Sep 2023 11:25:28 -0700 Subject: [PATCH] Add fcitx5 module --- blocks.def.h | 3 ++- scripts/dwmblocks-mu4e | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/blocks.def.h b/blocks.def.h index 7824b69..b29e26a 100644 --- a/blocks.def.h +++ b/blocks.def.h @@ -4,6 +4,7 @@ static const Block blocks[] = { /*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/ // {"", "dwmblocks-battery", SECONDS(10), 0}, + {"", "[ \"$(fcitx5-remote)\" -eq 2 ] && printf '和' || printf '英'", 0, 2}, {"", "dwmblocks-mu4e", SECONDS(15), 0}, {"", "dwmblocks-volume", 0, 1}, {" ", "date +'%a %b %d'", SECONDS(30), 0}, @@ -20,4 +21,4 @@ static const ThreadCallback thread_callbacks[] = { // sets delimeter between status commands. NULL character ('\0') means no delimeter. static char delim[] = " "; -static unsigned int delimLen = 5; +static unsigned int delimLen = 2; diff --git a/scripts/dwmblocks-mu4e b/scripts/dwmblocks-mu4e index 7a711cc..df100b1 100755 --- a/scripts/dwmblocks-mu4e +++ b/scripts/dwmblocks-mu4e @@ -1,3 +1,3 @@ #!/usr/bin/env zsh -let message_count="$(mu find flag:unread AND maildir:/protonmail/Inbox | wc -l)" +let message_count="$(mu find flag:unread AND maildir:/protonmail/Inbox 2>/dev/null | wc -l)" (( "${message_count}" > 0 )) && printf ' %s' "${message_count}"