Add dunst polybar module

This commit is contained in:
Thomas Dehaeze 2019-06-22 17:21:08 +02:00
parent e23f7c8e83
commit 3f39b06856

View File

@ -442,10 +442,33 @@
* Dunst * Dunst
#+BEGIN_SRC conf #+BEGIN_SRC conf
[module/dunst] [module/dunst]
type = custom/text type = custom/script
content = ""
click-left = dunstify --replace=10524 "Notifications Disabled" && sleep 2 && dunstify "DUNST_COMMAND_PAUSE" format-underline = ${colors.background}
click-right = dunstify "DUNST_COMMAND_RESUME" && dunstify --replace=10524 "Notifications Resumed" click-left = ~/bin/notifToggle
format = <label>
exec = ~/.config/polybar/scripts/dunst.sh
interval = 2
#+END_SRC
** Dunst Status script
:PROPERTIES:
:header-args: :tangle ~/.config/polybar/scripts/dunst.sh
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+BEGIN_SRC bash
tmpfile="/tmp/dunststatus";
if [ -f $tmpfile ]; then
if grep -q "on" $tmpfile; then
echo "";
elif grep -q "off" $tmpfile; then
echo "%{F#FB4934}%{F-}";
fi
else
echo "";
fi
#+END_SRC #+END_SRC
* Weather * Weather