Update dunst module to include more buttons and history count

- Change filesystem module interval to 10 minutes
- Add more modules for dunst
- Change power menu module icon
- Change some media module components from scripts to text
This commit is contained in:
Sravan Balaji
2024-05-03 18:59:48 -04:00
parent fff5a42a45
commit 33a8f5bb9a
3 changed files with 155 additions and 84 deletions

View File

@@ -5989,18 +5989,20 @@ Define module update intervals in seconds.
| Seconds | Minutes | Hours | | Seconds | Minutes | Hours |
|---------+---------+-------| |---------+---------+-------|
| 600 | 10 | 0.17 |
| 900 | 15 | 0.25 | | 900 | 15 | 0.25 |
| 86400 | 1440 | 24 | | 86400 | 1440 | 24 |
#+BEGIN_SRC conf :tangle polybar/config.ini #+BEGIN_SRC conf :tangle polybar/config.ini
[intervals] [intervals]
cpu = 1
date = 1
time = 1
filesystem = 900
memory = 1
media-playing = 1 media-playing = 1
kernel = 86400 kernel = 86400
cpu = 1
memory = 1
filesystem = 600
date = 1
time = 1
dunst = 1
#+END_SRC #+END_SRC
**** Global Window Manager **** Global Window Manager
@@ -6143,7 +6145,7 @@ font-5 = "IPAPGothic:size=11;3"
; modules-right = ipc clock ; modules-right = ipc clock
modules-left = powermenu-left powermenu powermenu-right dwm volume-left volume volume-right media-playing-left media-playing-change media-playing-prev media-playing-play-pause media-playing-next media-playing media-playing-right modules-left = powermenu-left powermenu powermenu-right dwm volume-left volume volume-right media-playing-left media-playing-change media-playing-prev media-playing-play-pause media-playing-next media-playing media-playing-right
; modules-center = ; modules-center =
modules-right = kernel-left kernel kernel-right cpu-left cpu cpu-right memory-left memory memory-right filesystem-left filesystem filesystem-right date-left date date-right time-left time time-right dunst-left dunst dunst-right modules-right = kernel-left kernel kernel-right cpu-left cpu cpu-right memory-left memory memory-right filesystem-left filesystem filesystem-right date-left date date-right time-left time time-right dunst-left dunst-status dunst-history-view dunst-history-clear dunst-history-length dunst-right
; The separator will be inserted between the output of each module ; The separator will be inserted between the output of each module
separator = "" separator = ""
@@ -6273,7 +6275,7 @@ content-padding = ${sizes.module-padding}
[module/powermenu] [module/powermenu]
type = custom/text type = custom/text
; content = " Menu" ; content = " Menu"
content = "" content = "󰀻"
; content = "" ; content = ""
; "content" has the same properties as "format-NAME" ; "content" has the same properties as "format-NAME"
@@ -6463,16 +6465,14 @@ click-left = "/home/sravan/.scripts/playerctl.sh --change"
#+BEGIN_SRC conf :tangle polybar/config.ini #+BEGIN_SRC conf :tangle polybar/config.ini
[module/media-playing-prev] [module/media-playing-prev]
type = custom/script type = custom/text
exec = echo "󰒮" content = "󰒮"
format = <label> content-foreground = ${colors.media-playing-foreground}
label = %output% content-background = ${colors.media-playing-background}
label-foreground = ${colors.media-playing-foreground} content-underline = ${colors.media-playing-underline}
label-background = ${colors.media-playing-background} content-overline = ${colors.media-playing-overline}
label-underline = ${colors.media-playing-underline} content-maxlen = ${sizes.maxlen}
label-overline = ${colors.media-playing-overline} content-padding = 1
label-maxlen = ${sizes.maxlen}
label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --prev" click-left = "/home/sravan/.scripts/playerctl.sh --prev"
#+END_SRC #+END_SRC
@@ -6493,16 +6493,14 @@ click-left = "/home/sravan/.scripts/playerctl.sh --play-pause"
#+BEGIN_SRC conf :tangle polybar/config.ini #+BEGIN_SRC conf :tangle polybar/config.ini
[module/media-playing-next] [module/media-playing-next]
type = custom/script type = custom/text
exec = echo "󰒭" content = "󰒭"
format = <label> content-foreground = ${colors.media-playing-foreground}
label = %output% content-background = ${colors.media-playing-background}
label-foreground = ${colors.media-playing-foreground} content-underline = ${colors.media-playing-underline}
label-background = ${colors.media-playing-background} content-overline = ${colors.media-playing-overline}
label-underline = ${colors.media-playing-underline} content-maxlen = ${sizes.maxlen}
label-overline = ${colors.media-playing-overline} content-padding = 1
label-maxlen = ${sizes.maxlen}
label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --next" click-left = "/home/sravan/.scripts/playerctl.sh --next"
#+END_SRC #+END_SRC
@@ -7085,6 +7083,8 @@ click-right = "/home/sravan/.scripts/deadd.sh --rofi"
**** Dunst **** Dunst
***** Module
#+BEGIN_SRC conf :tangle polybar/config.ini #+BEGIN_SRC conf :tangle polybar/config.ini
[module/dunst-left] [module/dunst-left]
type = custom/text type = custom/text
@@ -7106,26 +7106,68 @@ content-padding = ${sizes.module-padding}
#+END_SRC #+END_SRC
#+BEGIN_SRC conf :tangle polybar/config.ini #+BEGIN_SRC conf :tangle polybar/config.ini
[module/dunst] [module/dunst-status]
type = custom/text type = custom/script
content = "󰂚" exec = ~/.config/dwm-flexipatch/polybar/scripts/dunst-status.sh
interval = ${intervals.dunst}
format = <label>
label = %output%
label-foreground = ${colors.dunst-foreground}
label-background = ${colors.dunst-background}
label-underline = ${colors.dunst-underline}
label-overline = ${colors.dunst-overline}
label-padding = ${sizes.module-padding}
click-left = "dunstctl set-paused toggle"
#+END_SRC
; "content" has the same properties as "format-NAME" #+BEGIN_SRC conf :tangle polybar/config.ini
; content-background = #000 [module/dunst-history-view]
type = custom/text
content = "󰋚"
content-foreground = ${colors.dunst-foreground} content-foreground = ${colors.dunst-foreground}
content-background = ${colors.dunst-background} content-background = ${colors.dunst-background}
content-underline = ${colors.dunst-underline} content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline} content-overline = ${colors.dunst-overline}
content-padding = ${sizes.module-padding} content-padding = 1
; "click-(left|middle|right)" will be executed using "/bin/sh -c $COMMAND"
click-left = "/home/sravan/.scripts/dunst.sh --history" click-left = "/home/sravan/.scripts/dunst.sh --history"
; click-middle = notify-send middle #+END_SRC
click-right = "/home/sravan/.scripts/dunst.sh --rofi"
; "scroll-(up|down)" will be executed using "/bin/sh -c $COMMAND" #+BEGIN_SRC conf :tangle polybar/config.ini
; scroll-up = notify-send scroll up [module/dunst-history-clear]
; scroll-down = notify-send scroll down type = custom/text
content = "󰎟"
content-foreground = ${colors.dunst-foreground}
content-background = ${colors.dunst-background}
content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline}
content-padding = 1
click-left = "dunstctl history-clear"
#+END_SRC
#+BEGIN_SRC conf :tangle polybar/config.ini
[module/dunst-history-length]
type = custom/script
exec = "dunstctl count history"
interval = ${intervals.dunst}
format = <label>
label = %output%
label-foreground = ${colors.dunst-foreground}
label-background = ${colors.dunst-background}
label-underline = ${colors.dunst-underline}
label-overline = ${colors.dunst-overline}
label-padding = 1
#+END_SRC
***** Script
#+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle polybar/scripts/dunst-status.sh
isPaused=$(dunstctl is-paused)
if [[ "$isPaused" == "true" ]]; then
echo "󰂛"
else
echo "󰂚"
fi
#+END_SRC #+END_SRC
**** xfce4-notifyd **** xfce4-notifyd

View File

@@ -134,13 +134,14 @@ tray-scale = ${xrdb:polybar.tray-scale:1}
maxlen = ${xrdb:polybar.maxlen:50} maxlen = ${xrdb:polybar.maxlen:50}
[intervals] [intervals]
cpu = 1
date = 1
time = 1
filesystem = 900
memory = 1
media-playing = 1 media-playing = 1
kernel = 86400 kernel = 86400
cpu = 1
memory = 1
filesystem = 600
date = 1
time = 1
dunst = 1
[global/wm] [global/wm]
; Adjust the _NET_WM_STRUT_PARTIAL top value ; Adjust the _NET_WM_STRUT_PARTIAL top value
@@ -275,7 +276,7 @@ font-5 = "IPAPGothic:size=11;3"
; modules-right = ipc clock ; modules-right = ipc clock
modules-left = powermenu-left powermenu powermenu-right dwm volume-left volume volume-right media-playing-left media-playing-change media-playing-prev media-playing-play-pause media-playing-next media-playing media-playing-right modules-left = powermenu-left powermenu powermenu-right dwm volume-left volume volume-right media-playing-left media-playing-change media-playing-prev media-playing-play-pause media-playing-next media-playing media-playing-right
; modules-center = ; modules-center =
modules-right = kernel-left kernel kernel-right cpu-left cpu cpu-right memory-left memory memory-right filesystem-left filesystem filesystem-right date-left date date-right time-left time time-right dunst-left dunst dunst-right modules-right = kernel-left kernel kernel-right cpu-left cpu cpu-right memory-left memory memory-right filesystem-left filesystem filesystem-right date-left date date-right time-left time time-right dunst-left dunst-status dunst-history-view dunst-history-clear dunst-history-length dunst-right
; The separator will be inserted between the output of each module ; The separator will be inserted between the output of each module
separator = "" separator = ""
@@ -395,7 +396,7 @@ content-padding = ${sizes.module-padding}
[module/powermenu] [module/powermenu]
type = custom/text type = custom/text
; content = " Menu" ; content = " Menu"
content = "" content = "󰀻"
; content = "" ; content = ""
; "content" has the same properties as "format-NAME" ; "content" has the same properties as "format-NAME"
@@ -567,16 +568,14 @@ label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --change" click-left = "/home/sravan/.scripts/playerctl.sh --change"
[module/media-playing-prev] [module/media-playing-prev]
type = custom/script type = custom/text
exec = echo "󰒮" content = "󰒮"
format = <label> content-foreground = ${colors.media-playing-foreground}
label = %output% content-background = ${colors.media-playing-background}
label-foreground = ${colors.media-playing-foreground} content-underline = ${colors.media-playing-underline}
label-background = ${colors.media-playing-background} content-overline = ${colors.media-playing-overline}
label-underline = ${colors.media-playing-underline} content-maxlen = ${sizes.maxlen}
label-overline = ${colors.media-playing-overline} content-padding = 1
label-maxlen = ${sizes.maxlen}
label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --prev" click-left = "/home/sravan/.scripts/playerctl.sh --prev"
[module/media-playing-play-pause] [module/media-playing-play-pause]
@@ -593,16 +592,14 @@ label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --play-pause" click-left = "/home/sravan/.scripts/playerctl.sh --play-pause"
[module/media-playing-next] [module/media-playing-next]
type = custom/script type = custom/text
exec = echo "󰒭" content = "󰒭"
format = <label> content-foreground = ${colors.media-playing-foreground}
label = %output% content-background = ${colors.media-playing-background}
label-foreground = ${colors.media-playing-foreground} content-underline = ${colors.media-playing-underline}
label-background = ${colors.media-playing-background} content-overline = ${colors.media-playing-overline}
label-underline = ${colors.media-playing-underline} content-maxlen = ${sizes.maxlen}
label-overline = ${colors.media-playing-overline} content-padding = 1
label-maxlen = ${sizes.maxlen}
label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --next" click-left = "/home/sravan/.scripts/playerctl.sh --next"
[module/date-left] [module/date-left]
@@ -1051,26 +1048,50 @@ content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline} content-overline = ${colors.dunst-overline}
content-padding = ${sizes.module-padding} content-padding = ${sizes.module-padding}
[module/dunst] [module/dunst-status]
type = custom/text type = custom/script
content = "󰂚" exec = ~/.config/dwm-flexipatch/polybar/scripts/dunst-status.sh
interval = ${intervals.dunst}
format = <label>
label = %output%
label-foreground = ${colors.dunst-foreground}
label-background = ${colors.dunst-background}
label-underline = ${colors.dunst-underline}
label-overline = ${colors.dunst-overline}
label-padding = ${sizes.module-padding}
click-left = "dunstctl set-paused toggle"
; "content" has the same properties as "format-NAME" [module/dunst-history-view]
; content-background = #000 type = custom/text
content = "󰋚"
content-foreground = ${colors.dunst-foreground} content-foreground = ${colors.dunst-foreground}
content-background = ${colors.dunst-background} content-background = ${colors.dunst-background}
content-underline = ${colors.dunst-underline} content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline} content-overline = ${colors.dunst-overline}
content-padding = ${sizes.module-padding} content-padding = 1
; "click-(left|middle|right)" will be executed using "/bin/sh -c $COMMAND"
click-left = "/home/sravan/.scripts/dunst.sh --history" click-left = "/home/sravan/.scripts/dunst.sh --history"
; click-middle = notify-send middle
click-right = "/home/sravan/.scripts/dunst.sh --rofi"
; "scroll-(up|down)" will be executed using "/bin/sh -c $COMMAND" [module/dunst-history-clear]
; scroll-up = notify-send scroll up type = custom/text
; scroll-down = notify-send scroll down content = "󰎟"
content-foreground = ${colors.dunst-foreground}
content-background = ${colors.dunst-background}
content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline}
content-padding = 1
click-left = "dunstctl history-clear"
[module/dunst-history-length]
type = custom/script
exec = "dunstctl count history"
interval = ${intervals.dunst}
format = <label>
label = %output%
label-foreground = ${colors.dunst-foreground}
label-background = ${colors.dunst-background}
label-underline = ${colors.dunst-underline}
label-overline = ${colors.dunst-overline}
label-padding = 1
[module/xfce4-notifyd-left] [module/xfce4-notifyd-left]
type = custom/text type = custom/text

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
isPaused=$(dunstctl is-paused)
if [[ "$isPaused" == "true" ]]; then
echo "󰂛"
else
echo "󰂚"
fi