Add dunst modules in a drawer group

This commit is contained in:
Sravan Balaji
2024-09-29 21:10:43 -04:00
parent d53e47220f
commit 5e04c8685d
4 changed files with 169 additions and 20 deletions

View File

@@ -42,15 +42,16 @@
- [[#configuration-1][Configuration]] - [[#configuration-1][Configuration]]
- [[#styling][Styling]] - [[#styling][Styling]]
- [[#modules][Modules]] - [[#modules][Modules]]
- [[#battery][battery]] - [[#battery][Battery]]
- [[#cpu][cpu]] - [[#cpu][CPU]]
- [[#clock][clock]] - [[#clock][Clock]]
- [[#custompower-menu][custom/power-menu]] - [[#dunst][Dunst]]
- [[#dwltags][dwl/tags]] - [[#power-menu][Power Menu]]
- [[#disk][disk]] - [[#dwl][dwl]]
- [[#memory][memory]] - [[#disk][Disk]]
- [[#pulseaudio][pulseaudio]] - [[#memory][Memory]]
- [[#tray][tray]] - [[#pulseaudio][Pulseaudio]]
- [[#tray][Tray]]
- [[#end-configuration][End Configuration]] - [[#end-configuration][End Configuration]]
- [[#justfile][Justfile]] - [[#justfile][Justfile]]
@@ -540,8 +541,23 @@ sleep 5
"memory", "memory",
"disk", "disk",
"battery", "battery",
"clock" "clock",
"group/dunst",
], ],
"group/dunst": {
"orientation": "horizontal",
"modules": [
"custom/dunst-status",
"custom/dunst-history-view",
"custom/dunst-clear",
"custom/dunst-history-clear",
],
"drawer": {
"transition-duration": 500,
"transition-left-to-right": true,
"click-to-reveal": false,
},
},
#+END_SRC #+END_SRC
*** Styling *** Styling
@@ -561,7 +577,7 @@ window#waybar {
** Modules ** Modules
*** battery *** Battery
**** Configuration **** Configuration
@@ -584,7 +600,7 @@ window#waybar {
} }
#+END_SRC #+END_SRC
*** cpu *** CPU
**** Configuration **** Configuration
@@ -605,7 +621,7 @@ window#waybar {
} }
#+END_SRC #+END_SRC
*** clock *** Clock
**** Configuration **** Configuration
@@ -625,7 +641,73 @@ window#waybar {
} }
#+END_SRC #+END_SRC
*** custom/power-menu *** Dunst
**** Configuration
#+BEGIN_SRC jsonc :tangle waybar/config.jsonc
"custom/dunst-status": {
"exec": "~/.config/dwl/waybar/scripts/dunst.sh",
"restart-interval": 1,
"on-click": "~/.scripts/dunst.sh --dnd",
"on-click-right": "~/.scripts/dunst.sh --rofi",
"tooltip": false,
},
"custom/dunst-clear": {
"format": "",
"on-click": "~/.scripts/dunst.sh --close-all",
"tooltip": true,
"tooltip-format": "Close Open Notifications",
},
"custom/dunst-history-view": {
"format": "󰋚",
"on-click": "~/.scripts/dunst.sh --history",
"tooltip": true,
"tooltip-format": "View Notification History",
},
"custom/dunst-history-clear": {
"format": "󰎟",
"on-click": "~/.scripts/dunst.sh --history-clear",
"tooltip": true,
"tooltip-format": "Clear Notification History",
},
#+END_SRC
**** Styling
#+BEGIN_SRC css :tangle waybar/style.css
#custom-dunst-status {
background: #50fa7b;
color: #282a36;
}
#custom-dunst-clear {
background: #50fa7b;
color: #282a36;
}
#custom-dunst-history-view {
background: #50fa7b;
color: #282a36;
}
#custom-dunst-history-clear {
background: #50fa7b;
color: #282a36;
}
#+END_SRC
**** Script
#+BEGIN_SRC shell :shebang #!/usr/bin/env bash :tangle waybar/scripts/dunst.sh
isPaused=$(dunstctl is-paused)
notificationCount=$(dunstctl count history)
if [[ "$isPaused" == "true" ]]; then
echo "󰂛 $notificationCount"
else
echo "󰂚 $notificationCount"
fi
#+END_SRC
*** Power Menu
**** Configuration **** Configuration
@@ -646,7 +728,7 @@ window#waybar {
} }
#+END_SRC #+END_SRC
*** dwl/tags *** dwl
**** Configuration **** Configuration
@@ -684,7 +766,7 @@ window#waybar {
} }
#+END_SRC #+END_SRC
*** disk *** Disk
**** Configuration **** Configuration
@@ -706,7 +788,7 @@ window#waybar {
} }
#+END_SRC #+END_SRC
*** memory *** Memory
**** Configuration **** Configuration
@@ -728,7 +810,7 @@ window#waybar {
} }
#+END_SRC #+END_SRC
*** pulseaudio *** Pulseaudio
**** Configuration **** Configuration
@@ -763,7 +845,7 @@ window#waybar {
} }
#+END_SRC #+END_SRC
*** tray *** Tray
**** Configuration **** Configuration

View File

@@ -25,8 +25,23 @@
"memory", "memory",
"disk", "disk",
"battery", "battery",
"clock" "clock",
"group/dunst",
], ],
"group/dunst": {
"orientation": "horizontal",
"modules": [
"custom/dunst-status",
"custom/dunst-history-view",
"custom/dunst-clear",
"custom/dunst-history-clear",
],
"drawer": {
"transition-duration": 500,
"transition-left-to-right": true,
"click-to-reveal": false,
},
},
"battery": { "battery": {
"interval": 60, "interval": 60,
@@ -47,6 +62,32 @@
"format": "󰥔 {:%H:%M}" "format": "󰥔 {:%H:%M}"
}, },
"custom/dunst-status": {
"exec": "~/.config/dwl/waybar/scripts/dunst.sh",
"restart-interval": 1,
"on-click": "~/.scripts/dunst.sh --dnd",
"on-click-right": "~/.scripts/dunst.sh --rofi",
"tooltip": false,
},
"custom/dunst-clear": {
"format": "",
"on-click": "~/.scripts/dunst.sh --close-all",
"tooltip": true,
"tooltip-format": "Close Open Notifications",
},
"custom/dunst-history-view": {
"format": "󰋚",
"on-click": "~/.scripts/dunst.sh --history",
"tooltip": true,
"tooltip-format": "View Notification History",
},
"custom/dunst-history-clear": {
"format": "󰎟",
"on-click": "~/.scripts/dunst.sh --history-clear",
"tooltip": true,
"tooltip-format": "Clear Notification History",
},
"custom/power-menu": { "custom/power-menu": {
"format": "󰀻", "format": "󰀻",
"on-click": "rofi -show combi", "on-click": "rofi -show combi",

9
waybar/scripts/dunst.sh Executable file
View File

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

View File

@@ -24,6 +24,23 @@ window#waybar {
color: #282a36; color: #282a36;
} }
#custom-dunst-status {
background: #50fa7b;
color: #282a36;
}
#custom-dunst-clear {
background: #50fa7b;
color: #282a36;
}
#custom-dunst-history-view {
background: #50fa7b;
color: #282a36;
}
#custom-dunst-history-clear {
background: #50fa7b;
color: #282a36;
}
#custom-power-menu { #custom-power-menu {
background: #8be9fd; background: #8be9fd;
color: #282a36; color: #282a36;