Mise à jour de '.i3blocks/dunst'
This commit is contained in:
parent
86fe4882e9
commit
c8f20c6f44
1 changed files with 12 additions and 6 deletions
18
.i3blocks/dunst
Executable file → Normal file
18
.i3blocks/dunst
Executable file → Normal file
|
@ -3,25 +3,31 @@
|
|||
runtime="${XDG_RUNTIME_DIR}/i3blocks"
|
||||
[[ ! -d "$runtime" ]] && mkdir -p "$runtime"
|
||||
|
||||
active=$(systemctl --user show -p ActiveState --value dunst.service)
|
||||
|
||||
if [[ -n "$button" ]]
|
||||
then
|
||||
pid=$(systemctl --user show -p MainPID --value dunst.service)
|
||||
if [[ -f "$runtime/dunst" ]]
|
||||
then
|
||||
killall -SIGUSR2 $pid
|
||||
kill -SIGUSR2 $pid
|
||||
rm "$runtime/dunst"
|
||||
else
|
||||
killall -SIGUSR1 $pid
|
||||
kill -SIGUSR1 $pid
|
||||
touch "$runtime/dunst"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -n "dunst "
|
||||
|
||||
if [[ -f "$runtime/dunst" ]]
|
||||
if [[ "$active" == "active" ]]
|
||||
then
|
||||
echo "<span foreground=\"#FFCC66\">█</span>"
|
||||
if [[ -f "$runtime/dunst" ]]
|
||||
then
|
||||
echo "<span foreground=\"#FFCC66\">█</span>"
|
||||
else
|
||||
echo "<span foreground=\"#99CC99\">█</span>"
|
||||
fi
|
||||
else
|
||||
echo "<span foreground=\"#99CC99\">█</span>"
|
||||
echo "<span foreground=\"#F2777A\">█</span>"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue