From 8b4f6321d21575dec70eb0034aba4a87a8f28fef Mon Sep 17 00:00:00 2001 From: Sravan Balaji Date: Sat, 27 Feb 2021 12:14:44 -0500 Subject: [PATCH] Change Dunst Config & Fix Launch Script - Change dunstrc text alignment to center - Add appname to dunst notifications - Change dunst separator color to auto - Fix launch_dunst.sh to be executable and get values before running dunst - Add updated polybar module icon - Add executable permissions to launch_dunst.sh --- .config/dunst/dunstrc | 6 ++-- .config/dunst/launch_dunst.sh | 52 ++++++++++++++++++++++++----------- .config/polybar | 2 +- 3 files changed, 40 insertions(+), 20 deletions(-) mode change 100644 => 100755 .config/dunst/launch_dunst.sh diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc index 3efc5a9..ecd3c13 100644 --- a/.config/dunst/dunstrc +++ b/.config/dunst/dunstrc @@ -72,7 +72,7 @@ # * foreground: use the same color as the foreground; # * frame: use the same color as the frame; # * anything else will be interpreted as a X color. - separator_color = frame + separator_color = auto # Sort messages by urgency. sort = yes @@ -126,11 +126,11 @@ # %n progress value if set without any extra characters # %% Literal % # Markup is allowed - format = "%s %p\n%b" + format = "%s | %a %p\n%b" # Alignment of message text. # Possible values are "left", "center" and "right". - alignment = left + alignment = center # Vertical alignment of message text and icon. # Possible values are "top", "center" and "bottom". diff --git a/.config/dunst/launch_dunst.sh b/.config/dunst/launch_dunst.sh old mode 100644 new mode 100755 index 86f2d74..0886d2e --- a/.config/dunst/launch_dunst.sh +++ b/.config/dunst/launch_dunst.sh @@ -1,18 +1,38 @@ #!/bin/bash -/usr/bin/dunst -config ~/.config/dunst/dunstrc \ - -geometry "0x0-$(xgetres dunst.geometry-x)+$(xgetres dunst.geometry-y)" \ - -separator_height "$(xgetres dunst.sep-height)" \ - -padding "$(xgetres dunst.padding)" \ - -horizontal_padding "$(xgetres dunst.horiz-padding)" \ - -max_icon_size "$(xgetres dunst.max-icon-size)" \ - -frame_width "$(xgetres dunst.frame-width)" \ - -lb "$(xgetres dunst.low-background)" \ - -lf "$(xgetres dunst.low-foreground)" \ - -lfr "$(xgetres dunst.low-frame)" \ - -nb "$(xgetres dunst.normal-background)" \ - -nf "$(xgetres dunst.normal-foreground)" \ - -nfr "$(xgetres dunst.normal-frame)" \ - -cb "$(xgetres dunst.critical-background)" \ - -cf "$(xgetres dunst.critical-foreground)" \ - -cfr "$(xgetres dunst.critical-frame)" +# Get values from Xresources +config=~/.config/dunst/dunstrc +geometry_x=$(xgetres dunst.geometry-x) +geometry_y=$(xgetres dunst.geometry-y) +separator_height=$(xgetres dunst.sep-height) +padding=$(xgetres dunst.padding) +horizontal_padding=$(xgetres dunst.horiz-padding) +max_icon_size=$(xgetres dunst.max-icon-size) +frame_width=$(xgetres dunst.frame-width) +lb=$(xgetres dunst.low-background) +lf=$(xgetres dunst.low-foreground) +lfr=$(xgetres dunst.low-frame) +nb=$(xgetres dunst.normal-background) +nf=$(xgetres dunst.normal-foreground) +nfr=$(xgetres dunst.normal-frame) +cb=$(xgetres dunst.critical-background) +cf=$(xgetres dunst.critical-foreground) +cfr=$(xgetres dunst.critical-frame) + +# Kill and running dunst instances and start +killall dunst;/usr/bin/dunst -config $config \ + -geometry "0x0-$geometry_x+$geometry_y" \ + -separator_height "$separator_height" \ + -padding "$padding" \ + -horizontal_padding "$horizontal_padding" \ + -max_icon_size "$max_icon_size" \ + -frame_width "$frame_width" \ + -lb "$lb" \ + -lf "$lf" \ + -lfr "$lfr" \ + -nb "$nb" \ + -nf "$nf" \ + -nfr "$nfr" \ + -cb "$cb" \ + -cf "$cf" \ + -cfr "$cfr" diff --git a/.config/polybar b/.config/polybar index 6ae0ce3..1a26902 160000 --- a/.config/polybar +++ b/.config/polybar @@ -1 +1 @@ -Subproject commit 6ae0ce38d34af2e56e797c465e0ee5357c3b0d4d +Subproject commit 1a26902b50bfdba2021ed491b3069399bf07279c