summaryrefslogtreecommitdiff
path: root/examples/screenshots.conf
blob: 6532bab529e7958e1ec459dfdd3ed1385867b280 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
;; -*- mode: lisp -*-
;; vim: set ft=lisp :
;;
;; screenshots.conf — rename screenshots by date, then file them by year.
;;
;; Demonstrates: (rename ...) with the {mtime:FMT} placeholder run before
;; (move ...) — a rule's steps run in the order written, and a later step
;; sees the name or path an earlier one just produced — so the date lands
;; in the file's own name, not only in its destination.
;;
;; To use: copy this to dirs/<name>.conf, fix (path ...) below, and add
;; <name> to (include ...) in krino.conf. A short tutorial on the syntax is
;; docs/sexp-primer.md in the source repository, installed alongside this
;; file at $PREFIX/share/doc/krino/sexp-primer.md; every form is described
;; in krino.conf(5).

(path "~/Pictures")             ; CHANGE THIS to the directory to sort

;; Leave partial downloads and dotfiles alone.
(ignore "*.part" "*.crdownload" "*.aria2" ".*")

(rule "screenshots"
  (when (type image)
        (name "screenshot"))    ; case-insensitive by default; adjust to taste
  (rename "{mtime:%Y-%m-%d}_{name}")
  (move "Filed/Screenshots/{mtime:%Y}")
  (stop))