From 769fb6a1d2c1fb15945fb6a42be23a133890f818 Mon Sep 17 00:00:00 2001 From: Jakob L. Kreuze Date: Sat, 30 Mar 2019 16:20:57 -0400 Subject: dunst-alert for ERC notifications --- jakob.org | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/jakob.org b/jakob.org index d8b60d9..0cc917a 100644 --- a/jakob.org +++ b/jakob.org @@ -118,6 +118,25 @@ which aren't loaded by default. (require 'cl-extra) #+END_SRC +** Notification Daemon + +I have yet to find a way of dealing with pop-up notifications natively in Emacs +that I'm happy with, so for now, I'm just using [[https://dunst-project.org/][Dunst]]. + +#+BEGIN_SRC elisp +(call-process-shell-command "nohup dunst >/dev/null &" nil 0) +#+END_SRC + +Simple function for sending an alert to the daemon. + +#+BEGIN_SRC elisp +(defun dunst-alert (header string &rest objects) + "Send an alert to the Dunst daemon." + (let ((string (funcall #'format string objects)) + (command (format "notify-send -a \"%s\" \"%s\"" header string))) + (call-process-shell-command command nil 0))) +#+END_SRC + ** Configuration Bind some keys for working with this configuration file. @@ -1654,6 +1673,15 @@ Enable a hook for automatically identifying with Bitlbee. (erc-join . bitlbee-identify)) #+END_SRC +Enable a hook for showing a pop-up alert upon being highlighted. + +#+BEGIN_SRC elisp +(use-package ercn + :init + (when-all-loaded erc + (add-hook 'ercn-notify 'dunst-alert))) +#+END_SRC + Configure =erc-hl-nicks= to show names using pretty colors. #+BEGIN_SRC elisp -- cgit v1.3