Show unseen mails in bar
This commit is contained in:
parent
dc57edf7c7
commit
d332f80a8f
1 changed files with 20 additions and 3 deletions
|
@ -10,6 +10,17 @@ let
|
|||
echo -e '\uf130'
|
||||
fi
|
||||
'';
|
||||
mail-status = pkgs.writeScript "mail-status" ''
|
||||
#!${pkgs.zsh}/bin/zsh
|
||||
|
||||
mails=$(${pkgs.mblaze}/bin/mlist -N ~/mail/*/INBOX | wc -l)
|
||||
if [ "$mails" -gt 0 ]
|
||||
then
|
||||
echo "{ \"state\": \"Info\", \"text\": \" 📬 $mails\" }"
|
||||
else
|
||||
echo "{ \"state\": \"Idle\", \"text\": \" 📭 $mails\" }"
|
||||
fi
|
||||
'';
|
||||
in
|
||||
pkgs.writeText "configuration.toml" ''
|
||||
[theme]
|
||||
|
@ -19,11 +30,11 @@ pkgs.writeText "configuration.toml" ''
|
|||
idle_fg="#535c65"
|
||||
info_bg="#2b7ab2"
|
||||
info_fg="#fbffff"
|
||||
good_bg="#2b7ab2"
|
||||
good_bg="#4d7f43"
|
||||
good_fg="#fbffff"
|
||||
warning_bg="#2b7ab2"
|
||||
warning_bg="#906c33"
|
||||
warning_fg="#fbffff"
|
||||
critical_bg="#2b7ab2"
|
||||
critical_bg="#ae5865"
|
||||
critical_fg="#fbffff"
|
||||
separator=""
|
||||
|
||||
|
@ -78,6 +89,12 @@ pkgs.writeText "configuration.toml" ''
|
|||
interval = 1
|
||||
on_click = "${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle"
|
||||
|
||||
[[block]]
|
||||
block = "custom"
|
||||
json = true
|
||||
command = "${mail-status}"
|
||||
interval = 10
|
||||
|
||||
[[block]]
|
||||
block = "time"
|
||||
interval = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue