Compare commits

..

4 Commits

Author SHA1 Message Date
Sravan Balaji
1fbc9b35d8 Add click action to kernel module to display fastfetch 2024-05-03 19:10:42 -04:00
Sravan Balaji
33a8f5bb9a 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
2024-05-03 18:59:48 -04:00
Sravan Balaji
fff5a42a45 Merge remote-tracking branch 'upstream/master' 2024-05-03 17:50:10 -04:00
bakkeby
79404e419f Fix for dwm crashing following unmapping of systray window that had been moved to another monitor ref. #423 2024-05-02 22:08:16 +02:00
5 changed files with 166 additions and 93 deletions

View File

@@ -5989,18 +5989,20 @@ Define module update intervals in seconds.
| Seconds | Minutes | Hours |
|---------+---------+-------|
| 600 | 10 | 0.17 |
| 900 | 15 | 0.25 |
| 86400 | 1440 | 24 |
#+BEGIN_SRC conf :tangle polybar/config.ini
[intervals]
cpu = 1
date = 1
time = 1
filesystem = 900
memory = 1
media-playing = 1
kernel = 86400
media-playing = 1
kernel = 86400
cpu = 1
memory = 1
filesystem = 600
date = 1
time = 1
dunst = 1
#+END_SRC
**** Global Window Manager
@@ -6143,7 +6145,7 @@ font-5 = "IPAPGothic:size=11;3"
; 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-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
separator = ""
@@ -6273,7 +6275,7 @@ content-padding = ${sizes.module-padding}
[module/powermenu]
type = custom/text
; content = " Menu"
content = ""
content = "󰀻"
; content = ""
; "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
[module/media-playing-prev]
type = custom/script
exec = echo "󰒮"
format = <label>
label = %output%
label-foreground = ${colors.media-playing-foreground}
label-background = ${colors.media-playing-background}
label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen}
label-padding = 1
type = custom/text
content = "󰒮"
content-foreground = ${colors.media-playing-foreground}
content-background = ${colors.media-playing-background}
content-underline = ${colors.media-playing-underline}
content-overline = ${colors.media-playing-overline}
content-maxlen = ${sizes.maxlen}
content-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --prev"
#+END_SRC
@@ -6493,16 +6493,14 @@ click-left = "/home/sravan/.scripts/playerctl.sh --play-pause"
#+BEGIN_SRC conf :tangle polybar/config.ini
[module/media-playing-next]
type = custom/script
exec = echo "󰒭"
format = <label>
label = %output%
label-foreground = ${colors.media-playing-foreground}
label-background = ${colors.media-playing-background}
label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen}
label-padding = 1
type = custom/text
content = "󰒭"
content-foreground = ${colors.media-playing-foreground}
content-background = ${colors.media-playing-background}
content-underline = ${colors.media-playing-underline}
content-overline = ${colors.media-playing-overline}
content-maxlen = ${sizes.maxlen}
content-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --next"
#+END_SRC
@@ -6762,7 +6760,7 @@ interval = ${intervals.kernel}
; Available tags:
; <output> - deprecated
; <label> (default)
format = <label>
format = %{A1:kitty fastfetch:}<label>%{A}
format-foreground = ${colors.kernel-foreground}
format-background = ${colors.kernel-background}
format-underline = ${colors.kernel-underline}
@@ -7085,6 +7083,8 @@ click-right = "/home/sravan/.scripts/deadd.sh --rofi"
**** Dunst
***** Module
#+BEGIN_SRC conf :tangle polybar/config.ini
[module/dunst-left]
type = custom/text
@@ -7106,26 +7106,68 @@ content-padding = ${sizes.module-padding}
#+END_SRC
#+BEGIN_SRC conf :tangle polybar/config.ini
[module/dunst]
type = custom/text
content = "󰂚"
[module/dunst-status]
type = custom/script
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"
; content-background = #000
#+BEGIN_SRC conf :tangle polybar/config.ini
[module/dunst-history-view]
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 = ${sizes.module-padding}
; "click-(left|middle|right)" will be executed using "/bin/sh -c $COMMAND"
content-padding = 1
click-left = "/home/sravan/.scripts/dunst.sh --history"
; click-middle = notify-send middle
click-right = "/home/sravan/.scripts/dunst.sh --rofi"
#+END_SRC
; "scroll-(up|down)" will be executed using "/bin/sh -c $COMMAND"
; scroll-up = notify-send scroll up
; scroll-down = notify-send scroll down
#+BEGIN_SRC conf :tangle polybar/config.ini
[module/dunst-history-clear]
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
**** xfce4-notifyd

4
dwm.c
View File

@@ -2516,8 +2516,10 @@ manage(Window w, XWindowAttributes *wa)
#endif // CENTER_TRANSIENT_WINDOWS_PATCH | CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH | CENTER_PATCH
} else {
#if SEAMLESS_RESTART_PATCH
if (!settings_restored)
if (!settings_restored || c->mon == NULL) {
c->mon = selmon;
settings_restored = 0;
}
#else
c->mon = selmon;
#endif // SEAMLESS_RESTART_PATCH

View File

@@ -39,12 +39,12 @@ persistclientstate(Client *c)
int
restoreclientstate(Client *c)
{
return getclienttags(c)
| getclientfields(c)
#if SAVEFLOATS_PATCH
| restorewindowfloatposition(c, c->mon ? c->mon : selmon)
#endif // SAVEFLOATS_PATCH
;
int restored = getclientfields(c);
getclienttags(c);
#if SAVEFLOATS_PATCH
restorewindowfloatposition(c, c->mon ? c->mon : selmon);
#endif // SAVEFLOATS_PATCH
return restored;
}
void setmonitorfields(Monitor *m)

View File

@@ -134,13 +134,14 @@ tray-scale = ${xrdb:polybar.tray-scale:1}
maxlen = ${xrdb:polybar.maxlen:50}
[intervals]
cpu = 1
date = 1
time = 1
filesystem = 900
memory = 1
media-playing = 1
kernel = 86400
media-playing = 1
kernel = 86400
cpu = 1
memory = 1
filesystem = 600
date = 1
time = 1
dunst = 1
[global/wm]
; Adjust the _NET_WM_STRUT_PARTIAL top value
@@ -275,7 +276,7 @@ font-5 = "IPAPGothic:size=11;3"
; 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-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
separator = ""
@@ -395,7 +396,7 @@ content-padding = ${sizes.module-padding}
[module/powermenu]
type = custom/text
; content = " Menu"
content = ""
content = "󰀻"
; content = ""
; "content" has the same properties as "format-NAME"
@@ -567,16 +568,14 @@ label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --change"
[module/media-playing-prev]
type = custom/script
exec = echo "󰒮"
format = <label>
label = %output%
label-foreground = ${colors.media-playing-foreground}
label-background = ${colors.media-playing-background}
label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen}
label-padding = 1
type = custom/text
content = "󰒮"
content-foreground = ${colors.media-playing-foreground}
content-background = ${colors.media-playing-background}
content-underline = ${colors.media-playing-underline}
content-overline = ${colors.media-playing-overline}
content-maxlen = ${sizes.maxlen}
content-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --prev"
[module/media-playing-play-pause]
@@ -593,16 +592,14 @@ label-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --play-pause"
[module/media-playing-next]
type = custom/script
exec = echo "󰒭"
format = <label>
label = %output%
label-foreground = ${colors.media-playing-foreground}
label-background = ${colors.media-playing-background}
label-underline = ${colors.media-playing-underline}
label-overline = ${colors.media-playing-overline}
label-maxlen = ${sizes.maxlen}
label-padding = 1
type = custom/text
content = "󰒭"
content-foreground = ${colors.media-playing-foreground}
content-background = ${colors.media-playing-background}
content-underline = ${colors.media-playing-underline}
content-overline = ${colors.media-playing-overline}
content-maxlen = ${sizes.maxlen}
content-padding = 1
click-left = "/home/sravan/.scripts/playerctl.sh --next"
[module/date-left]
@@ -747,7 +744,7 @@ interval = ${intervals.kernel}
; Available tags:
; <output> - deprecated
; <label> (default)
format = <label>
format = %{A1:kitty fastfetch:}<label>%{A}
format-foreground = ${colors.kernel-foreground}
format-background = ${colors.kernel-background}
format-underline = ${colors.kernel-underline}
@@ -1051,26 +1048,50 @@ content-underline = ${colors.dunst-underline}
content-overline = ${colors.dunst-overline}
content-padding = ${sizes.module-padding}
[module/dunst]
type = custom/text
content = "󰂚"
[module/dunst-status]
type = custom/script
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"
; content-background = #000
[module/dunst-history-view]
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 = ${sizes.module-padding}
; "click-(left|middle|right)" will be executed using "/bin/sh -c $COMMAND"
content-padding = 1
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"
; scroll-up = notify-send scroll up
; scroll-down = notify-send scroll down
[module/dunst-history-clear]
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"
[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]
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