41 lines
908 B
Scheme
41 lines
908 B
Scheme
(add-to-load-path ".")
|
|
(use-modules (org helpers)
|
|
(org format)
|
|
(importers photo)
|
|
(importers battery))
|
|
|
|
(use-modules (srfi srfi-19)) ;date
|
|
|
|
(use-modules (ice-9 textual-ports)) ; put-string
|
|
(define photo-dir "/home/nixo/memories/inbox/photos/moto/Camera")
|
|
|
|
(map
|
|
(lambda (x) (get-creation x))
|
|
(list-pictures photo-dir))
|
|
|
|
(set! *path-format* "~Y/~m/~d")
|
|
(set! *move-files* #t)
|
|
|
|
(date->path (current-date))
|
|
|
|
|
|
(for-each
|
|
(lambda (file)
|
|
(let ((output (open-file "example.org" "a+")))
|
|
(put-string output (string-concatenate
|
|
`(,(image->org file) "\n")))
|
|
(close-port output)))
|
|
(list-head (list-pictures photo-dir) 3))
|
|
|
|
|
|
(set! *battery-path* "/org/freedesktop/UPower/devices/battery_BAT1")
|
|
|
|
(define (battery-to-org file)
|
|
(let ((output (open-file file "a+")))
|
|
(put-string output (battery->org *battery-path*))
|
|
(close-port output)))
|
|
|
|
|
|
|
|
(battery-to-org "battery2.org")
|