Skip to content

Commit

Permalink
Add documentation with examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
m00natic committed Sep 1, 2012
1 parent 01da43b commit 525a2e2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.org
@@ -0,0 +1,28 @@
RASE - Run At Sun Event

This is an Emacs extension that allows user provided set of functions
to be run at some sun events, right now - sunrise and sunset.

Usage example:

#+BEGIN_SRC emacs-lisp
(require 'rase)

;; create a one argument function to be invoked at sun events
(defun switch-themes (sun-event)
"Switch themes on sunrise and sunset."
(cond ((eq sun-event 'sunrise)
(ignore-errors
(disable-theme 'wombat))
(enable-theme 'whiteboard))
((eq sun-event 'sunset)
(ignore-errors
(disable-theme 'whiteboard))
(enable-theme 'wombat))))

;; sign this function to be invoked on sun events
(add-to-list rase-hook 'switch-themes)

;; start the run-at-sun-event daemon
(rase-start t)
#+END_SRC
16 changes: 16 additions & 0 deletions rase.el
Expand Up @@ -20,6 +20,22 @@
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:
;; This is an Emacs extension that allows user provided set of
;; functions to be run at some sun events.

;;; Usage:
;; create a one argument function to be invoked at sun events, like
;; (defun switch-themes (sun-event)
;; (cond ((eq sun-event 'sunrise)
;; ...set ligthish theme...)
;; ((eq sun-event 'sunset)
;; ...set darkish theme...)))

;; sign this function to be invoked on sun events
;; (add-to-list rase-hook 'switch-themes)

;; start the run-at-sun-event daemon
;; (rase-start t)

;;; Code:

Expand Down

0 comments on commit 525a2e2

Please sign in to comment.