Skip to content

emacsfodder/clockface-icons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Clockicon

Using https://ocodo.github.io/ClockFace-font in Emacs

(require 'cl-lib)

(defun clockface-icons-unicode (hours minutes)
  "Return clock icon unicode for HOURS and MINUTES."
  (let* ((minute (- minutes (% minutes 5)))
         (offset (+ (* (% hours 12) 12) (* 12 (/ minute 60)))))
       (+ offset #xE800)))

(defun clockface-icons-now-unicode ()
  "Return clock icon unicode for the time now."
  (cl-destructuring-bind
      (_ _ hour minute &rest n) (decode-time)
    (clockicon-unicode hour minute)))
    
(defface clockface-icons '((t (:family ClockFace))) "ClockFace icons")
(defface clockface-icons-solid '((t (:family ClockFaceSolid))) "ClockFaceSolid icons")
(defface clockface-icons-rect '((t (:family ClockFaceRect))) "ClockFaceRect icons")
(defface clockface-icons-rect-solid '((t (:family ClockFaceRectSolid))) "ClockFaceRectSolid icons")