xfce4-notifyd unmanage windows and polybar module

- Enable unmanaged patch
- Make xfce4-notifyd windows unmanaged instead of floating
- Change notification command to xfce4-notifyd
- Update polybar config to use xfce4-notifyd for notification module
This commit is contained in:
Sravan Balaji 2024-05-01 20:13:55 -04:00
parent 3268ba4179
commit d298f3da81
4 changed files with 101 additions and 11 deletions

View File

@ -3230,14 +3230,12 @@ https://dwm.suckless.org/patches/unfloatvisible/
*** Unmanaged *** Unmanaged
This patch adds a client rule that allows for windows that do not specify the override-redirect This patch adds a client rule that allows for windows that do not specify the override-redirect to not be managed by the window manager. This can be useful for external bars, widgets, launchers, docks, desktop icons and more.
to not be managed by the window manager. This can be useful for external bars, widgets,
launchers, docks, desktop icons and more.
https://github.com/bakkeby/patches/wiki/unmanaged https://github.com/bakkeby/patches/wiki/unmanaged
#+BEGIN_SRC c :tangle patches.def.h #+BEGIN_SRC c :tangle patches.def.h
#define UNMANAGED_PATCH 0 #define UNMANAGED_PATCH 1
#+END_SRC #+END_SRC
*** Vanity Gaps *** Vanity Gaps
@ -4329,7 +4327,7 @@ static const Rule rules[] = {
RULE(.wintype = WTYPE "TOOLBAR", .isfloating = 1) RULE(.wintype = WTYPE "TOOLBAR", .isfloating = 1)
RULE(.wintype = WTYPE "SPLASH", .isfloating = 1) RULE(.wintype = WTYPE "SPLASH", .isfloating = 1)
RULE(.title = "Picture in picture", .isfloating = 1) RULE(.title = "Picture in picture", .isfloating = 1)
RULE(.class = "Xfce4-notifyd", .isfloating = 1) RULE(.class = "Xfce4-notifyd", .unmanaged = 1) // 1 - the window will be placed above all other windows
RULE(.class = "Beeper", .tags = 1 << 0) RULE(.class = "Beeper", .tags = 1 << 0)
RULE(.class = "Signal", .tags = 1 << 0) RULE(.class = "Signal", .tags = 1 << 0)
RULE(.class = "discord", .tags = 1 << 0) RULE(.class = "discord", .tags = 1 << 0)
@ -4798,7 +4796,7 @@ static const char *clipboardcmd[] = { "rofi", "-show", "clipboard", NULL
static const char *rbwcmd[] = { "rofi-rbw", NULL }; static const char *rbwcmd[] = { "rofi-rbw", NULL };
static const char *volumecmd[] = { "/home/sravan/.scripts/pactl.sh", "--rofi", NULL }; static const char *volumecmd[] = { "/home/sravan/.scripts/pactl.sh", "--rofi", NULL };
static const char *mediacmd[] = { "/home/sravan/.scripts/playerctl.sh", "--rofi", NULL }; static const char *mediacmd[] = { "/home/sravan/.scripts/playerctl.sh", "--rofi", NULL };
static const char *notificationcmd[] = { "/home/sravan/.scripts/deadd.sh", "--rofi", NULL }; static const char *notificationcmd[] = { "/home/sravan/.scripts/xfce4-notifyd.sh", "--rofi", NULL };
static const char *sessioncmd[] = { "/home/sravan/.scripts/session.sh", "--rofi", NULL }; static const char *sessioncmd[] = { "/home/sravan/.scripts/session.sh", "--rofi", NULL };
static const char *compositorcmd[] = { "/home/sravan/.scripts/picom.sh", "--rofi", NULL }; static const char *compositorcmd[] = { "/home/sravan/.scripts/picom.sh", "--rofi", NULL };
static const char *lowervolumecmd[] = { "/home/sravan/.scripts/pactl.sh", "--lower", NULL }; static const char *lowervolumecmd[] = { "/home/sravan/.scripts/pactl.sh", "--lower", NULL };
@ -5956,6 +5954,11 @@ deadd-notification-center-background = ${self.background}
deadd-notification-center-underline = ${self.background} deadd-notification-center-underline = ${self.background}
deadd-notification-center-overline = ${self.background} deadd-notification-center-overline = ${self.background}
xfce4-notifyd-foreground = ${self.green}
xfce4-notifyd-background = ${self.background}
xfce4-notifyd-underline = ${self.background}
xfce4-notifyd-overline = ${self.background}
volume-foreground = ${self.red} volume-foreground = ${self.red}
volume-background = ${self.background} volume-background = ${self.background}
volume-underline = ${self.background} volume-underline = ${self.background}
@ -6135,7 +6138,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 deadd-notification-center-left deadd-notification-center deadd-notification-center-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 xfce4-notifyd-left xfce4-notifyd xfce4-notifyd-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 = ""
@ -7075,6 +7078,51 @@ click-right = "/home/sravan/.scripts/deadd.sh --rofi"
; scroll-down = notify-send scroll down ; scroll-down = notify-send scroll down
#+END_SRC #+END_SRC
**** xfce4-notifyd
#+BEGIN_SRC conf :tangle polybar/config.ini
[module/xfce4-notifyd-left]
type = custom/text
content = " "
content-foreground = ${colors.xfce4-notifyd-background}
content-underline = ${colors.xfce4-notifyd-underline}
content-overline = ${colors.xfce4-notifyd-overline}
content-padding = ${sizes.module-padding}
#+END_SRC
#+BEGIN_SRC conf :tangle polybar/config.ini
[module/xfce4-notifyd-right]
type = custom/text
content = " "
content-foreground = ${colors.xfce4-notifyd-background}
content-underline = ${colors.xfce4-notifyd-underline}
content-overline = ${colors.xfce4-notifyd-overline}
content-padding = ${sizes.module-padding}
#+END_SRC
#+BEGIN_SRC conf :tangle polybar/config.ini
[module/xfce4-notifyd]
type = custom/text
content = "󰂚"
; "content" has the same properties as "format-NAME"
; content-background = #000
content-foreground = ${colors.xfce4-notifyd-foreground}
content-background = ${colors.xfce4-notifyd-background}
content-underline = ${colors.xfce4-notifyd-underline}
content-overline = ${colors.xfce4-notifyd-overline}
content-padding = ${sizes.module-padding}
; "click-(left|middle|right)" will be executed using "/bin/sh -c $COMMAND"
click-left = "/home/sravan/.scripts/xfce4-notifyd.sh --toggle-center"
; click-middle = notify-send middle
click-right = "/home/sravan/.scripts/xfce4-notifyd.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
#+END_SRC
**** Pulseaudio **** Pulseaudio
#+BEGIN_SRC conf :tangle polybar/config.ini #+BEGIN_SRC conf :tangle polybar/config.ini

View File

@ -474,7 +474,7 @@ static const Rule rules[] = {
RULE(.wintype = WTYPE "TOOLBAR", .isfloating = 1) RULE(.wintype = WTYPE "TOOLBAR", .isfloating = 1)
RULE(.wintype = WTYPE "SPLASH", .isfloating = 1) RULE(.wintype = WTYPE "SPLASH", .isfloating = 1)
RULE(.title = "Picture in picture", .isfloating = 1) RULE(.title = "Picture in picture", .isfloating = 1)
RULE(.class = "Xfce4-notifyd", .isfloating = 1) RULE(.class = "Xfce4-notifyd", .unmanaged = 1) // 1 - the window will be placed above all other windows
RULE(.class = "Beeper", .tags = 1 << 0) RULE(.class = "Beeper", .tags = 1 << 0)
RULE(.class = "Signal", .tags = 1 << 0) RULE(.class = "Signal", .tags = 1 << 0)
RULE(.class = "discord", .tags = 1 << 0) RULE(.class = "discord", .tags = 1 << 0)
@ -886,7 +886,7 @@ static const char *clipboardcmd[] = { "rofi", "-show", "clipboard", NULL
static const char *rbwcmd[] = { "rofi-rbw", NULL }; static const char *rbwcmd[] = { "rofi-rbw", NULL };
static const char *volumecmd[] = { "/home/sravan/.scripts/pactl.sh", "--rofi", NULL }; static const char *volumecmd[] = { "/home/sravan/.scripts/pactl.sh", "--rofi", NULL };
static const char *mediacmd[] = { "/home/sravan/.scripts/playerctl.sh", "--rofi", NULL }; static const char *mediacmd[] = { "/home/sravan/.scripts/playerctl.sh", "--rofi", NULL };
static const char *notificationcmd[] = { "/home/sravan/.scripts/deadd.sh", "--rofi", NULL }; static const char *notificationcmd[] = { "/home/sravan/.scripts/xfce4-notifyd.sh", "--rofi", NULL };
static const char *sessioncmd[] = { "/home/sravan/.scripts/session.sh", "--rofi", NULL }; static const char *sessioncmd[] = { "/home/sravan/.scripts/session.sh", "--rofi", NULL };
static const char *compositorcmd[] = { "/home/sravan/.scripts/picom.sh", "--rofi", NULL }; static const char *compositorcmd[] = { "/home/sravan/.scripts/picom.sh", "--rofi", NULL };
static const char *lowervolumecmd[] = { "/home/sravan/.scripts/pactl.sh", "--lower", NULL }; static const char *lowervolumecmd[] = { "/home/sravan/.scripts/pactl.sh", "--lower", NULL };

View File

@ -361,7 +361,7 @@
#define UNFLOATVISIBLE_PATCH 1 #define UNFLOATVISIBLE_PATCH 1
#define UNMANAGED_PATCH 0 #define UNMANAGED_PATCH 1
#define VANITYGAPS_PATCH 1 #define VANITYGAPS_PATCH 1

View File

@ -109,6 +109,11 @@ deadd-notification-center-background = ${self.background}
deadd-notification-center-underline = ${self.background} deadd-notification-center-underline = ${self.background}
deadd-notification-center-overline = ${self.background} deadd-notification-center-overline = ${self.background}
xfce4-notifyd-foreground = ${self.green}
xfce4-notifyd-background = ${self.background}
xfce4-notifyd-underline = ${self.background}
xfce4-notifyd-overline = ${self.background}
volume-foreground = ${self.red} volume-foreground = ${self.red}
volume-background = ${self.background} volume-background = ${self.background}
volume-underline = ${self.background} volume-underline = ${self.background}
@ -265,7 +270,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 deadd-notification-center-left deadd-notification-center deadd-notification-center-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 xfce4-notifyd-left xfce4-notifyd xfce4-notifyd-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 = ""
@ -1025,6 +1030,43 @@ click-right = "/home/sravan/.scripts/deadd.sh --rofi"
; scroll-up = notify-send scroll up ; scroll-up = notify-send scroll up
; scroll-down = notify-send scroll down ; scroll-down = notify-send scroll down
[module/xfce4-notifyd-left]
type = custom/text
content = " "
content-foreground = ${colors.xfce4-notifyd-background}
content-underline = ${colors.xfce4-notifyd-underline}
content-overline = ${colors.xfce4-notifyd-overline}
content-padding = ${sizes.module-padding}
[module/xfce4-notifyd-right]
type = custom/text
content = " "
content-foreground = ${colors.xfce4-notifyd-background}
content-underline = ${colors.xfce4-notifyd-underline}
content-overline = ${colors.xfce4-notifyd-overline}
content-padding = ${sizes.module-padding}
[module/xfce4-notifyd]
type = custom/text
content = "󰂚"
; "content" has the same properties as "format-NAME"
; content-background = #000
content-foreground = ${colors.xfce4-notifyd-foreground}
content-background = ${colors.xfce4-notifyd-background}
content-underline = ${colors.xfce4-notifyd-underline}
content-overline = ${colors.xfce4-notifyd-overline}
content-padding = ${sizes.module-padding}
; "click-(left|middle|right)" will be executed using "/bin/sh -c $COMMAND"
click-left = "/home/sravan/.scripts/xfce4-notifyd.sh --toggle-center"
; click-middle = notify-send middle
click-right = "/home/sravan/.scripts/xfce4-notifyd.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/volume-left] [module/volume-left]
type = custom/text type = custom/text
content = " " content = " "