summaryrefslogtreecommitdiff
path: root/stumpwm/modules/modeline/fuzzytime
diff options
context:
space:
mode:
Diffstat (limited to 'stumpwm/modules/modeline/fuzzytime')
-rw-r--r--stumpwm/modules/modeline/fuzzytime/README.org9
-rw-r--r--stumpwm/modules/modeline/fuzzytime/fuzzytime.asd11
-rw-r--r--stumpwm/modules/modeline/fuzzytime/fuzzytime.lisp84
-rw-r--r--stumpwm/modules/modeline/fuzzytime/package.lisp5
4 files changed, 0 insertions, 109 deletions
diff --git a/stumpwm/modules/modeline/fuzzytime/README.org b/stumpwm/modules/modeline/fuzzytime/README.org
deleted file mode 100644
index fbfc14f..0000000
--- a/stumpwm/modules/modeline/fuzzytime/README.org
+++ /dev/null
@@ -1,9 +0,0 @@
-** Usage
-Put:
-#+BEGIN_SRC lisp
-(load-module "fuzzytime")
-#+END_SRC
-in =~/.stumpwmrc= and then use =%F= in the mode-line format string.
-
-The output format and granularity may be customised by changing
-~*fuzzytime-format*~ and ~*minute-granularity*~ respectively.
diff --git a/stumpwm/modules/modeline/fuzzytime/fuzzytime.asd b/stumpwm/modules/modeline/fuzzytime/fuzzytime.asd
deleted file mode 100644
index 82a630b..0000000
--- a/stumpwm/modules/modeline/fuzzytime/fuzzytime.asd
+++ /dev/null
@@ -1,11 +0,0 @@
-;;;; fuzzytime.asd
-
-(asdf:defsystem #:fuzzytime
- :description "A module to display a fuzzy date and time in the modeline of StumpWM"
- :author "Tslil Clingman <tslil@posteo.de>"
- :license "GPLv3"
- :depends-on (#:stumpwm)
- :serial t
- :components ((:file "package")
- (:file "fuzzytime")))
-
diff --git a/stumpwm/modules/modeline/fuzzytime/fuzzytime.lisp b/stumpwm/modules/modeline/fuzzytime/fuzzytime.lisp
deleted file mode 100644
index 9a703a3..0000000
--- a/stumpwm/modules/modeline/fuzzytime/fuzzytime.lisp
+++ /dev/null
@@ -1,84 +0,0 @@
-;;;; fuzzytime.lisp
-
-(IN-PACKAGE #:FUZZYTIME)
-
-(EXPORT '(*FUZZYTIME-FORMAT* *MINUTE-GRANULARITY*))
-
-(PUSHNEW '(#\F LOCAL-TIME-TO-FUZZY) *SCREEN-MODE-LINE-FORMATTERS* :TEST 'EQUAL)
-
-(DEFPARAMETER *MINUTE-GRANULARITY* 10
- "Minutes are rounded to the nearest multiple of *minute-granularity*")
-
-(DEFPARAMETER *FUZZYTIME-FORMAT*
- '(:MINUTES :HOURS " in the " :PERIOD " on " :DOW
- " the " :DAY " of " :MONTH)
- "Format of the output, a list of strings and keywords. Valid keywords are:
-:minutes
-:hours
-:period
-:dow (name of the day of the week)
-:udow (name of the day of the week, capitalised)
-:dn (number of the day of the week)
-:day (day of the month)
-:mnum (number of the month)
-:month (name of the month, capitalised)
-:umonth (name of the month)")
-
-(DEFVAR *MONTH-NAMES*
- (MAKE-ARRAY '(12) :INITIAL-CONTENTS
- '("january" "february" "march" "april" "may" "june" "july"
- "august" "september" "october" "november" "december")))
-
-(DEFVAR *DOW-NAMES*
- (MAKE-ARRAY '(7) :INITIAL-CONTENTS
- '("monday" "tuesday" "wednesday"
- "thursday" "friday" "saturday"
- "sunday")))
-
-(DEFUN MINUTES-TO-WORDS (MIN)
- (IF (OR (<= MIN 0) (>= MIN 60)) ""
- (FLET ((FRAC (M) (COND
- ((= M 30) "half")
- ((= M 15) "quarter")
- (T (FORMAT NIL "~r" M)))))
- (FORMAT NIL "~a ~a " (FRAC (IF (> MIN 30) (- 60 MIN) MIN))
- (IF (> MIN 30) "to" "past")))))
-
-(DEFUN HOUR-TO-WORDS (HOUR MIN)
- (LET ((H (MOD
- (IF (> MIN 30) (1+ HOUR) HOUR )
- 12)))
- (FORMAT NIL "~r~a"
- (IF (= H 0) 12 H)
- (IF (OR (= MIN 0) (= MIN 60)) " o'clock" ""))))
-
-(DEFUN PERIOD-INDICATOR (HOUR)
- (IF (< HOUR 12) "morning"
- (IF (< HOUR 17) "afternoon" "evening")))
-
-(DEFUN LOCAL-TIME-TO-FUZZY (ML)
- (DECLARE (IGNORE ML))
- (MULTIPLE-VALUE-BIND (SECONDS MINUTES HOUR DAY MONTH YEAR DOW)
- (GET-DECODED-TIME)
- (DECLARE (IGNORE SECONDS) (IGNORE YEAR))
- (LET* ((MIN (* *MINUTE-GRANULARITY*
- (ROUND (/ MINUTES *MINUTE-GRANULARITY*))))
- (MS (MINUTES-TO-WORDS MIN))
- (HS (HOUR-TO-WORDS HOUR MIN))
- (PS (PERIOD-INDICATOR HOUR))
- (DN (ELT *DOW-NAMES* DOW))
- (MN (ELT *MONTH-NAMES* (1- MONTH))))
- (APPLY #'CONCATENATE 'STRING
- (LOOP FOR E IN *FUZZYTIME-FORMAT* COLLECT
- (CASE E
- (:MINUTES MS)
- (:HOURS HS)
- (:PERIOD PS)
- (:DOW DN)
- (:UDOW (STRING-CAPITALIZE DN))
- (:MONTH MN)
- (:UMONTH (STRING-CAPITALIZE MN))
- (:DNUM (FORMAT NIL "~a" DOW))
- (:DAY (FORMAT NIL "~:r" DAY))
- (:MNUM (FORMAT NIL "~a" MONTH))
- (OTHERWISE E)))))))
diff --git a/stumpwm/modules/modeline/fuzzytime/package.lisp b/stumpwm/modules/modeline/fuzzytime/package.lisp
deleted file mode 100644
index 944e195..0000000
--- a/stumpwm/modules/modeline/fuzzytime/package.lisp
+++ /dev/null
@@ -1,5 +0,0 @@
-;;;; package.lisp
-
-(defpackage #:fuzzytime
- (:use #:cl :stumpwm))
-