diff options
| author | Léana 江 <leana.jiang+git@icloud.com> | 2026-04-25 23:16:28 +0200 |
|---|---|---|
| committer | Léana 江 <leana.jiang+git@icloud.com> | 2026-04-25 23:27:35 +0200 |
| commit | 10bb1305eac8cd2a3b5d6bcd53982adb685f0c73 (patch) | |
| tree | 5fe27e769c4d08099d5341d6d50e6869508ebd1d /doc/plugins.org | |
| parent | 34d6b33443f3962bff5dd6e41ec8444c9a0c96e6 (diff) | |
| download | xmobar-10bb1305eac8cd2a3b5d6bcd53982adb685f0c73.tar.gz xmobar-10bb1305eac8cd2a3b5d6bcd53982adb685f0c73.tar.bz2 | |
add notify-once script and documentation
Diffstat (limited to 'doc/plugins.org')
| -rw-r--r-- | doc/plugins.org | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/doc/plugins.org b/doc/plugins.org index 4facc85..442af34 100644 --- a/doc/plugins.org +++ b/doc/plugins.org @@ -306,7 +306,7 @@ "--", "-O", "<fc=green>On</fc> - ", "-i", "", "-L", "-15", "-H", "-5", "-l", "red", "-m", "blue", "-h", "green", - "-a", "notify-send -u critical 'Battery running out!!'", + "-a", "notify-once \"xmobar\" -u critical 'Battery running out!!'", "-A", "3"] 600 #+end_src @@ -316,7 +316,19 @@ separator affect how =<watts>= is displayed. For this monitor, neither the generic nor the specific options have any effect on =<timeleft>=. We are also telling the monitor to execute the unix command - =notify-send= when the percentage left in the battery reaches 6%. + =notify-once= when the percentage left in the battery reaches 6%. + + =notify-once= is a bash wrapper script provided with the =xmobar= package. + =xmobar= will run the notification command according to the refresh period, + this has the effect of spamming the notification tray if calling =notify-send= directly. + =notify-once= script deduplicates the notification by indicating to =notify-send= + the last notification we want to replace. + See [[https://codeberg.org/xmobar/xmobar/issues/746][#746]] for more information. + Note that your notification daemon should handle notification replacement + for this to work. Whether the replacement resets the timeout is also handled by the + notification daemon. + For example, the =wired-notify= implementation has =replacing_enabled= + and =replacing_resets_timeout= configuration options [[https://github.com/Toqozz/wired-notify/wiki/Config]]. It is also possible to specify template variables in the =-O= and =-o= switches, as in the following example: |
