aboutsummaryrefslogtreecommitdiff
path: root/module/vulgar/components.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-06-01 21:56:52 +0200
committerHugo Hörnquist <hugo@hornquist.se>2019-06-01 21:56:58 +0200
commitb0d552ffe3e336606de907897181a0f0718b3149 (patch)
treef08d02b8bdead2106f1ca2377cd422f3694e3aa2 /module/vulgar/components.scm
parentRename {terminal => vulgar}. (diff)
downloadcalp-b0d552ffe3e336606de907897181a0f0718b3149.tar.gz
calp-b0d552ffe3e336606de907897181a0f0718b3149.tar.xz
Reword terminal output to better modularization.
Diffstat (limited to 'module/vulgar/components.scm')
-rw-r--r--module/vulgar/components.scm18
1 files changed, 18 insertions, 0 deletions
diff --git a/module/vulgar/components.scm b/module/vulgar/components.scm
new file mode 100644
index 00000000..507ee08b
--- /dev/null
+++ b/module/vulgar/components.scm
@@ -0,0 +1,18 @@
+(define-module (vulgar components)
+ #:use-module (srfi srfi-19)
+ #:use-module (util)
+ #:export ())
+
+(define-public (display-calendar-header! date)
+ (let* ((day (number->string (date-day date)))
+ (month (number->string (date-month date)))
+ (year (number->string (date-year date))))
+ ;; BSD cal only supports setting highlighted day explicitly for
+ ;; testing the functionality. This seems to at least give me
+ ;; an (almost) working display, albeit ugly.
+ (if (file-exists? "/usr/bin/ncal")
+ (system* "ncal" "-3" "-H" (format #f "~a-~a-~a"
+ year month day)
+ month year)
+ (system* "cal" "-3" day month year))))
+