20 lines
469 B
Scheme
Executable File
20 lines
469 B
Scheme
Executable File
#!/run/current-system/profile/bin/guile
|
|
!#
|
|
|
|
(add-to-load-path "../")
|
|
(use-modules (org helpers)
|
|
(org format)
|
|
(importers photo)
|
|
(importers battery))
|
|
|
|
(use-modules (ice-9 textual-ports)) ; put-string
|
|
|
|
(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 "mytest.org")
|