From 6962a79cf1df4c8807362e1d6afa47f9d0a00770 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Fri, 8 Nov 2019 15:53:35 -0500 Subject: [PATCH] Initial commit --- honk.el | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ honk.mp3 | Bin 0 -> 5686 bytes 2 files changed, 89 insertions(+) create mode 100644 honk.el create mode 100644 honk.mp3 diff --git a/honk.el b/honk.el new file mode 100644 index 0000000..4bdc7af --- /dev/null +++ b/honk.el @@ -0,0 +1,89 @@ +;;; honk.el --- Bad Goose -*- lexical-binding: t; -*- +;; Copyright (C) 2015-2019, Correl Roush + +;; Author: Correl Roush +;; URL: https://gist.github.com/correl/13047d283688ea408acc5c62270b0bfd +;; Version: 1.0 +;; Keywords: honk, goose +;; Package-Requires: (emms) + +;; This file is not part of GNU Emacs. + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: +;; +;; honk.el harasses you with honking every hour. It's possibly the worst (or +;; best) way to know the hour. +;; +;; Put this file into your load-path and the following into your ~/.emacs: +;; (require 'honk) +;; +;;; Code: + +(require 'emms-source-file) +(require 'emms-playlist-mode) + +(defconst *honk-directory* (file-name-directory (or load-file-name buffer-file-name)) + "Where the goose lives.") + +(defvar *honk-mp3* (concat *honk-directory* "honk.mp3") + "Path to the honk mp3 file.") + +(defvar *honk-timer* nil + "Timer to honk hourly.") + +(defun honk-the-hour () + "Honk the hour. More hours, more honks. + +It's particularly evil, as it'll take over your EMMS playlist, +trashing it in the process, and doing its own thing." + (interactive) + (progn + (setq emms-repeat-track nil + emms-repeat-playlist nil) + (emms-playlist-current-clear) + (let ((current-hour (nth 2 (decode-time (current-time))))) + (cl-dotimes (i current-hour) + (emms-add-file *honk-mp3*))) + + (with-current-emms-playlist + (goto-line 1) + (emms-playlist-mode-play-smart)))) + +(defun honk-hourly () + "Honk every hour, on the hour." + (interactive + (unless *honk-timer* + (let* ((now (decode-time (current-time))) + (next-hour + (time-add (encode-time + 0 + 0 + (nth 2 now) + (nth 3 now) + (nth 4 now) + (nth 5 now)) + 3600))) + (setq *honk-timer* + (run-at-time next-hour 3600 #'honk-the-hour)))))) + +(defun honk-stop () + "Cancel the hourly honk timer." + (interactive) + (when *honk-timer* + (cancel-timer *honk-timer*))) + +(provide 'honk) +;;; honk.el ends here diff --git a/honk.mp3 b/honk.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..7bacf9aac148c1a76d92a139ce2a07289a394f5b GIT binary patch literal 5686 zcmeI0cTg11w#SDkS%d{i!U9W9OO&9pO9lbSEI}j(l`L6c$!W=m1d+J#BS(>>ERvIe zM3pEYARG<);si^Qdy_Uiv4HJiGXHCZB*B3VX$1^#PH!mDj&2 z9PbrFYt_D*%iU^`1Vtdad0>pkj@yAj&3C|DS?9@6=i~MOikzw7!%q_LRyKz5^D@q) zeLEYMPJY@})oo2G;0S?e@jPjgm_i#OQ7RH-ZQU=6)n?b*;7N*-DQ15hg`}m>*eMV= z0_?bEw498YC>UIkRV>TMNJd{(A+TayKCzqU$yT#_(6=tB<=%`J>Zn=L+oKl8f{7in0 zy*^mHQMDqP?v79QYlXU7;f8+c#;*p&G0rs<#F*2(e69~-*Tc_8C%zbaE`SOkP8QnC z`jn`#56|hv`l+-|UNR-*lY(RC5<9l1#@^zl8VwD7qa01AeB$%GOa-aVxkA!DuHAi=63mwFYA_kF{%8&6vxLhA*+6d)SMil zPVa>}u5H5Ns1F1L#6Jyv*w=4Hv9Q9~+pmCNJb1)f8TS;~zsg(ouna-)h6WNIXXB`; zj_i&{P}HId@Mf|!1bgxfSi9;K^$EmG_Xr5~x*lmxNp&EJVx9;*B_k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