From 61a81bbd67e7e109cd1370dcb4c24d81f3baab14 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado <55825613+luevano@users.noreply.github.com> Date: Thu, 24 Dec 2020 16:29:43 -0700 Subject: Add dunst muting --- .config/polybar/common.ini | 2 ++ .config/polybar/config | 1 + .config/polybar/dunst.ini | 14 ++++++++++++++ .config/polybar/main.ini | 2 +- 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .config/polybar/dunst.ini diff --git a/.config/polybar/common.ini b/.config/polybar/common.ini index 19634c6..4bcf3eb 100644 --- a/.config/polybar/common.ini +++ b/.config/polybar/common.ini @@ -6,6 +6,8 @@ offset-y = 0% radius = 0.0 fixed-center = false +enable-ipc = true + font-0 = Noto Sans Mono:pixelsize=10;1 font-1 = Noto Color Emoji:scale=10;1 font-2 = Font Awesome 5 Free:pixelsize=10;1 diff --git a/.config/polybar/config b/.config/polybar/config index 4af1275..2c33cad 100644 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -31,6 +31,7 @@ include-file = $XDG_CONFIG_HOME/polybar/xkeyboard.ini include-file = $XDG_CONFIG_HOME/polybar/filesystem.ini include-file = $XDG_CONFIG_HOME/polybar/eth.ini include-file = $XDG_CONFIG_HOME/polybar/wlan.ini +include-file = $XDG_CONFIG_HOME/polybar/dunst.ini # Other modules that came by default on the example config. diff --git a/.config/polybar/dunst.ini b/.config/polybar/dunst.ini new file mode 100644 index 0000000..202eba0 --- /dev/null +++ b/.config/polybar/dunst.ini @@ -0,0 +1,14 @@ +[module/dunst] +type = custom/ipc +initial = 1 + +format = +format-underline = ${colors.purple} + +# For a single button to toggle use the %{An} tag on the hook variable +# where the command would be that of click-x. +hook-0 = echo "%{F$(xresource color2)}%{F-}" +hook-1 = echo "%{F$(xresource color1)}%{F-}" + +click-left = notify-send "DUNST_COMMAND_RESUME" && polybar-msg -p %pid% hook dunst 1 +click-right = notify-send "DUNST_COMMAND_PAUSE" && polybar-msg -p %pid% hook dunst 2 diff --git a/.config/polybar/main.ini b/.config/polybar/main.ini index 5c7c8f1..0fbabb8 100644 --- a/.config/polybar/main.ini +++ b/.config/polybar/main.ini @@ -4,7 +4,7 @@ monitor = ${env:MAINMON:HDMI-0} modules-left=bspwm xwindow modules-center= -modules-right=xkeyboard cpu memory pulseaudio date powermenu +modules-right=xkeyboard cpu memory pulseaudio date dunst powermenu # tray-position = right # tray-padding = 2 -- cgit v1.2.3-54-g00ecf