Skip to content

Emacs integration with the BurntToast PowerShell module.

License

Notifications You must be signed in to change notification settings

cedarbaum/burnt-toast.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

burnt-toast.el

CI MELPA

Emacs integration with the BurntToast PowerShell module.

This package contains 2 parts:

  1. A library that allows creating notifications via BurntToast.
  2. Integration with the Alert package.

Installation

First, ensure the BurntToast PowerShell module is installed:

Install-Module -Name BurntToast

Installing with MELPA and use-package

(use-package burnt-toast                  
  :if (eq system-type 'windows-nt)        
  :config                                 
  (require 'burnt-toast-alert)            
  (setq alert-default-style 'burnt-toast))

Installing manually

;; Add project to load-path
(add-to-list 'load-path "~/path/to/burnt-toast.el/")

(require 'burnt-toast)       ;; Load library.
(require 'burnt-toast-alert) ;; Load Alert integration (will load library too).

Usage

Alert integration

To use Alert style:

(require 'burnt-toast-alert)
(setq alert-default-style 'burnt-toast)

;; Test
(alert "This is an alert." :title "I <3 PowerShell")

Library functions

;; All notifications can have a header, which has a Title and Id. The Title is
;; displayed at the top of the notification. The Id is used to correlate the
;; notification with others.

;; Create a BT-Header
(burnt-toast-bt-header-object "Id" "Title")

;; Basic notifications
(burnt-toast-new-notification-with-sound
 :text "Some text"                                    ;; Main text
 :app-logo "path/to/image.png"                        ;; Optional icon
 :sound "Alarm10"                                     ;; Optional sound effect
 :header (burnt-toast-bt-header-object "Id" "Title")) ;; Optional header

(burnt-toast-new-notification-with-sound
 :text '("Line 1" "Line 2"))             ;; Text can be a list of strings for multiline messages

(burnt-toast-new-notification-silent
 :text "Some text"
 :app-logo "path/to/image.png"
 :header (burnt-toast-bt-header-object "Id" "Title"))

;; Snooze-and-dismiss notifications
(burnt-toast-new-notification-snooze-and-dismiss-with-sound
 :text "Some text"
 :app-logo "path/to/image.png"
 :sound "Alarm10"
 :header (burnt-toast-bt-header-object "Id" "Title"))

(burnt-toast-new-notification-snooze-and-dismiss-silent
 :text "Some text"
 :app-logo "path/to/image.png"
 :header (burnt-toast-bt-header-object "Id" "Title"))

;; Shoulder tap notifications
(burnt-toast-new-shoulder-tap
 "path/to/image.png"          ;; Image
 "person@domain.com"          ;; Person
 :text "Some text")

Related projects

  • BurntToast: PowerShell module powering notifications.
  • Alert: Emacs package for generating alerts.
  • erc-burnt-toast: BurntToast notifications for ERC.

Attributions

  • PowerShell sanitization based on erc-burnt-toast.
  • Icon is from Emacs source (commit: fd38c9c0afe2c5bbf04f565eec05daa52a16472b).

About

Emacs integration with the BurntToast PowerShell module.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published