├── README.org ├── frames ├── 00.png ├── 01.png ├── 02.png ├── 03.png ├── 04.png ├── 05.png ├── 06.png ├── 07.png ├── 08.png ├── 09.png ├── 10.png └── 11.png ├── marqueeo.el └── marqueeo.gif /README.org: -------------------------------------------------------------------------------- 1 | * MARQUEEO: Mario in the Emacs header line 2 | 3 | [[./marqueeo.gif]] 4 | -------------------------------------------------------------------------------- /frames/00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progfolio/marqueeo/771a891f0109196393cfd2b2c51f090bccad4b12/frames/00.png -------------------------------------------------------------------------------- /frames/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progfolio/marqueeo/771a891f0109196393cfd2b2c51f090bccad4b12/frames/01.png -------------------------------------------------------------------------------- /frames/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progfolio/marqueeo/771a891f0109196393cfd2b2c51f090bccad4b12/frames/02.png -------------------------------------------------------------------------------- /frames/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progfolio/marqueeo/771a891f0109196393cfd2b2c51f090bccad4b12/frames/03.png -------------------------------------------------------------------------------- /frames/04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progfolio/marqueeo/771a891f0109196393cfd2b2c51f090bccad4b12/frames/04.png -------------------------------------------------------------------------------- /frames/05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progfolio/marqueeo/771a891f0109196393cfd2b2c51f090bccad4b12/frames/05.png -------------------------------------------------------------------------------- /frames/06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progfolio/marqueeo/771a891f0109196393cfd2b2c51f090bccad4b12/frames/06.png -------------------------------------------------------------------------------- /frames/07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progfolio/marqueeo/771a891f0109196393cfd2b2c51f090bccad4b12/frames/07.png -------------------------------------------------------------------------------- /frames/08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progfolio/marqueeo/771a891f0109196393cfd2b2c51f090bccad4b12/frames/08.png -------------------------------------------------------------------------------- /frames/09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progfolio/marqueeo/771a891f0109196393cfd2b2c51f090bccad4b12/frames/09.png -------------------------------------------------------------------------------- /frames/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progfolio/marqueeo/771a891f0109196393cfd2b2c51f090bccad4b12/frames/10.png -------------------------------------------------------------------------------- /frames/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progfolio/marqueeo/771a891f0109196393cfd2b2c51f090bccad4b12/frames/11.png -------------------------------------------------------------------------------- /marqueeo.el: -------------------------------------------------------------------------------- 1 | ;;; marqueeo.el --- Mario in the header-line. -*- lexical-binding: t; -*- 2 | 3 | ;; Copyright (C) 2023 Nicholas Vollmer 4 | 5 | ;; Author: Nicholas Vollmer 6 | ;; Keywords: inconvenience 7 | 8 | ;; This program is free software; you can redistribute it and/or modify 9 | ;; it under the terms of the GNU General Public License as published by 10 | ;; the Free Software Foundation, either version 3 of the License, or 11 | ;; (at your option) any later version. 12 | 13 | ;; This program is distributed in the hope that it will be useful, 14 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ;; GNU General Public License for more details. 17 | 18 | ;; You should have received a copy of the GNU General Public License 19 | ;; along with this program. If not, see . 20 | 21 | ;;; Commentary: 22 | 23 | ;;; Code: 24 | (require 'cl-lib) 25 | 26 | (defgroup marqueeo nil "Mario in the header-line." :group 'applications :prefix "marqueeo-") 27 | (defcustom marqueeo-tick-interval (/ 1 30.0) "Rate at which to update header-line." :type 'float) 28 | (defvar-local marqueeo--previous-header-line nil) 29 | (defvar-local marqueeo-frames 30 | (let ((default-directory (file-name-directory (or load-file-name (buffer-file-name))))) 31 | (mapcar (lambda (f) (create-image f 'png nil :scale 0.25 :ascent 100 :heuristic-mask t)) 32 | (directory-files "./frames" t ".*.png")))) 33 | (defvar-local marqueeo-timer nil) 34 | (defvar-local marqueeo--frame-counter -1) 35 | (defun marqueeo-animation-function () 36 | "Animate." 37 | (when (> (cl-incf marqueeo--frame-counter) (window-width)) 38 | (setq marqueeo--frame-counter 0)) 39 | (concat 40 | (when (> marqueeo--frame-counter 1) 41 | (propertize " " 'display `(space :align-to ,marqueeo--frame-counter))) 42 | (propertize " " 'display (nth (mod marqueeo--frame-counter (length marqueeo-frames)) 43 | marqueeo-frames)))) 44 | 45 | (defun marqueeo-update-header-line (buffer) 46 | "Update the header-line in BUFFER." 47 | (with-current-buffer buffer 48 | (setq header-line-format (marqueeo-animation-function)))) 49 | 50 | (define-minor-mode marqueeo-mode 51 | "Minor mode to display an animation in the current buffer's `header-line'." 52 | :lighter " marqueeo" 53 | (if marqueeo-mode 54 | (setq marqueeo--previous-header-line header-line-format 55 | marqueeo-timer 56 | (run-at-time nil marqueeo-tick-interval 57 | (apply-partially #'marqueeo-update-header-line (current-buffer)))) 58 | (setq header-line-format marqueeo--previous-header-line) 59 | (cancel-timer marqueeo-timer))) 60 | 61 | (defalias 'its-a-him-marqueeo #'marqueeo-mode) 62 | (provide 'marqueeo) 63 | ;;; marqueeo.el ends here 64 | -------------------------------------------------------------------------------- /marqueeo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/progfolio/marqueeo/771a891f0109196393cfd2b2c51f090bccad4b12/marqueeo.gif --------------------------------------------------------------------------------