diff --git a/docs/dunst.pod b/docs/dunst.pod index 90973ac15..66a1833df 100644 --- a/docs/dunst.pod +++ b/docs/dunst.pod @@ -142,6 +142,32 @@ the notification on the left border of the screen while a horizontal offset of =back +=item B (values: [true/false], default: false) + +When an integer value is passed to dunst as a hint (see B), a +progress bar will be drawn at the bottom of the notification. This +behavior can be turned off by setting this setting to true. + +=item B (default: 10) + +The height of the progress bar in pixel. This includes the frame. Make sure +this value is bigger than twice the frame width. + +=item B (default: 150) + +The minimum width of the progress bar in pixels. The notification is rescaled +to fit the bar. + +=item B (default: 300) + +The maximum width of the progress bar in pixels. The notification is resized +to fit the progress bar. + +=item B (default: 1) + +The frame width of the progress bar in pixels. This value should be smaller +than half of the progress bar height. + =item B (values: [true/false], default: true) If this is set to true, a notification indicating how many notifications are @@ -561,8 +587,8 @@ Specifies the keyboard shortcut that opens the context menu. The urgency sections work in a similar way to rules and can be used to specify attributes for the different urgency levels of notifications (low, normal, -critical). Currently only the background, foreground, timeout, frame_color and -icon attributes can be modified. +critical). Currently only the background, foreground, hightlight, timeout, +frame_color and icon attributes can be modified. The urgency sections are urgency_low, urgency_normal, urgency_critical for low, normal and critical urgency respectively. @@ -595,6 +621,12 @@ Defines the background color for low, normal and critical notifications respecti See COLORS for the value format. +=item B<-lh/nh/ch color> + +Defines the highlight color for low, normal and critical notifications respectively. + +See COLORS for the value format. + =item B<-lfr/nfr/cfr color> Defines the frame color for low, normal and critical notifications respectively. @@ -725,7 +757,12 @@ The background color of the notification. See COLORS for possible values. =item C -The background color of the notification. See COLORS for possible values. +The foreground color of the notification. See COLORS for possible values. + +=item C + +The highlight color of the notification. This color is used for coloring the +progress bar. See COLORS for possible values. =item C diff --git a/test/functional-tests/dunstrc.progress_bar b/test/functional-tests/dunstrc.progress_bar new file mode 100644 index 000000000..fcdc672a0 --- /dev/null +++ b/test/functional-tests/dunstrc.progress_bar @@ -0,0 +1,10 @@ +[global] + font = Monospace 8 + allow_markup = yes + format = "%s\n%b" + geometry = "0x5-30+20" + icon_position = left + progress_bar_min_width = 100 + progress_bar_max_width = 200 + progress_bar_frame_width = 5 + progress_bar_height = 30 diff --git a/test/functional-tests/test.sh b/test/functional-tests/test.sh index ae3ca172f..0ea0d474e 100755 --- a/test/functional-tests/test.sh +++ b/test/functional-tests/test.sh @@ -177,12 +177,35 @@ function geometry { keypress } +function progress_bar { + killall dunst + ../../dunst -config dunstrc.default & + ../../dunstify -h int:value:0 -a "dunst tester" -u c "Progress bar 0%: " + ../../dunstify -h int:value:33 -a "dunst tester" -u c "Progress bar 33%: " + ../../dunstify -h int:value:66 -a "dunst tester" -u c "Progress bar 66%: " + ../../dunstify -h int:value:100 -a "dunst tester" -u c "Progress bar 100%: " + keypress + killall dunst + ../../dunst -config dunstrc.default & + ../../dunstify -h int:value:33 -a "dunst tester" -u l "Low priority: " + ../../dunstify -h int:value:33 -a "dunst tester" -u n "Normal priority: " + ../../dunstify -h int:value:33 -a "dunst tester" -u c "Critical priority: " + keypress + killall dunst + ../../dunst -config dunstrc.progress_bar & + ../../dunstify -h int:value:33 -a "dunst tester" -u n "The progress bar should not be the entire width" + ../../dunstify -h int:value:33 -a "dunst tester" -u n "You might also notice height and frame size are changed" + ../../dunstify -h int:value:33 -a "dunst tester" -u c "Short" + keypress +} + if [ -n "$1" ]; then while [ -n "$1" ]; do $1 shift done else + progress_bar geometry corners show_age