Updated: 2024-03-05 Tue 01:44

Notification Daemon Dunst

Configuring notification daemon - dunst

The goal is to configure `dunst` which describes itself as a lightweight notification daemon on i3-wm. You can get dunst from the community repository. Install it by:

pacman -S dunst

You should add it to the startup.

For i3 you can add exec_always dunst to your config file (~/.config/i3/config).

Next, a simple bash script where we will use the notification daemon to display a primitive ticking timer.

#!/bin/bash

i=0
limit=$1
while true; do
  notify-send -h int:value:$i Timer
  sleep 1
  i=$[$i+1]
  if [ $i -eq $time ]; then
    exit
  fi
done

What this script will do is invoke notify-send with a hint value to dunst which handles this as progress value using %p or %n format specifier. To enable this, you need to change some configuration options in dunstrc file (~/.config/dunst/dunstrc).

format = "<b>%s %n</b>\n%b"

stack_duplicates = yes
hide_duplicate_count = yes

Refs:

~
Generated by Emacs 29.1 (Org mode 9.6.6)