Merge branch 'master' of git.breizh.pm:Breizh/dotfiles

This commit is contained in:
Breizh 2020-03-03 21:09:43 +01:00
commit ae0cb061b6

16
.i3blocks/dunst Executable file → Normal file
View file

@ -3,25 +3,31 @@
runtime="${XDG_RUNTIME_DIR}/i3blocks" runtime="${XDG_RUNTIME_DIR}/i3blocks"
[[ ! -d "$runtime" ]] && mkdir -p "$runtime" [[ ! -d "$runtime" ]] && mkdir -p "$runtime"
active=$(systemctl --user show -p ActiveState --value dunst.service)
if [[ -n "$button" ]] if [[ -n "$button" ]]
then then
pid=$(systemctl --user show -p MainPID --value dunst.service) pid=$(systemctl --user show -p MainPID --value dunst.service)
if [[ -f "$runtime/dunst" ]] if [[ -f "$runtime/dunst" ]]
then then
killall -SIGUSR2 $pid kill -SIGUSR2 $pid
rm "$runtime/dunst" rm "$runtime/dunst"
else else
killall -SIGUSR1 $pid kill -SIGUSR1 $pid
touch "$runtime/dunst" touch "$runtime/dunst"
fi fi
fi fi
echo -n "dunst " echo -n "dunst "
if [[ -f "$runtime/dunst" ]] if [[ "$active" == "active" ]]
then then
if [[ -f "$runtime/dunst" ]]
then
echo "<span foreground=\"#FFCC66\">█</span>" echo "<span foreground=\"#FFCC66\">█</span>"
else else
echo "<span foreground=\"#99CC99\">█</span>" echo "<span foreground=\"#99CC99\">█</span>"
fi
else
echo "<span foreground=\"#F2777A\">█</span>"
fi fi