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 | | 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 media-playing = 1
date = 1 kernel = 86400
time = 1 cpu = 1
filesystem = 900 memory = 1
memory = 1 filesystem = 600
media-playing = 1 date = 1
kernel = 86400 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
@@ -6762,7 +6760,7 @@ interval = ${intervals.kernel}
; Available tags: ; Available tags:
; <output> - deprecated ; <output> - deprecated
; <label> (default) ; <label> (default)
format = <label> format = %{A1:kitty fastfetch:}<label>%{A}
format-foreground = ${colors.kernel-foreground} format-foreground = ${colors.kernel-foreground}
format-background = ${colors.kernel-background} format-background = ${colors.kernel-background}
format-underline = ${colors.kernel-underline} format-underline = ${colors.kernel-underline}
@@ -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

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 #endif // CENTER_TRANSIENT_WINDOWS_PATCH | CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH | CENTER_PATCH
} else { } else {
#if SEAMLESS_RESTART_PATCH #if SEAMLESS_RESTART_PATCH
if (!settings_restored) if (!settings_restored || c->mon == NULL) {
c->mon = selmon; c->mon = selmon;
settings_restored = 0;
}
#else #else
c->mon = selmon; c->mon = selmon;
#endif // SEAMLESS_RESTART_PATCH #endif // SEAMLESS_RESTART_PATCH

View File

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

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 media-playing = 1
date = 1 kernel = 86400
time = 1 cpu = 1
filesystem = 900 memory = 1
memory = 1 filesystem = 600
media-playing = 1 date = 1
kernel = 86400 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]
@@ -747,7 +744,7 @@ interval = ${intervals.kernel}
; Available tags: ; Available tags:
; <output> - deprecated ; <output> - deprecated
; <label> (default) ; <label> (default)
format = <label> format = %{A1:kitty fastfetch:}<label>%{A}
format-foreground = ${colors.kernel-foreground} format-foreground = ${colors.kernel-foreground}
format-background = ${colors.kernel-background} format-background = ${colors.kernel-background}
format-underline = ${colors.kernel-underline} format-underline = ${colors.kernel-underline}
@@ -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