Created
August 18, 2015 13:03
-
-
Save ralt/a1c41a4a56399897a63c to your computer and use it in GitHub Desktop.
stumpwm alert-me-at
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ql:quickload :bordeaux-threads) | |
(defcommand alert-me-at (alert-hour alert-minute message) ((:number "hour: ") (:number "minute: ") (:string "message: ")) | |
"Alert me at some point in time. Doesn't handle time too early, so the thread will go on forever." | |
(bordeaux-threads:make-thread | |
#'(lambda () | |
(loop | |
do (sleep 5) | |
when (multiple-value-bind (seconds minute hour) | |
(get-decoded-time) | |
(declare (ignore seconds)) | |
(and (= alert-hour hour) (= alert-minute minute))) | |
do (progn | |
(stumpwm:message "The timer for ~A is now! (1/3 remainder)" message) | |
(sleep 10) | |
(stumpwm:message "The timer for ~A is now! (2/3 remainder)" message) | |
(sleep 10) | |
(stumpwm:message "The timer for ~A is now! (3/3 remainder)" message) | |
(return)))) | |
:name (format nil "Alert thread: ~A" message))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment