diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/by-type.conf | 55 | ||||
| -rw-r--r-- | examples/invoices.conf | 33 | ||||
| -rw-r--r-- | examples/old-installers.conf | 26 | ||||
| -rw-r--r-- | examples/screenshots.conf | 27 |
4 files changed, 141 insertions, 0 deletions
diff --git a/examples/by-type.conf b/examples/by-type.conf new file mode 100644 index 0000000..5b363df --- /dev/null +++ b/examples/by-type.conf @@ -0,0 +1,55 @@ +;; -*- mode: lisp -*- +;; vim: set ft=lisp : +;; +;; by-type.conf — file everything into one folder per type group. +;; +;; Demonstrates: (type ...) with the built-in type groups, (move ...), and +;; (stop) so a file already claimed by one rule is never moved again by a +;; later one. The six groups below happen not to overlap each other, but +;; krino's type groups can (a .json file is both "code" and "text", for +;; instance — see TYPE GROUPS in krino.conf(5)), so (stop) is worth keeping +;; once you add rules of your own. +;; +;; To use: copy this to dirs/<name>.conf, fix (path ...) below, and add +;; <name> to (include ...) in krino.conf — or just run: +;; krino new <name> ~/wherever +;; and paste the (rule ...) forms in below the generated header. 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 "~/Downloads") ; CHANGE THIS to the directory to sort + +;; Leave partial downloads and dotfiles alone. +(ignore "*.part" "*.crdownload" "*.aria2" ".*") + +(rule "images" + (when (type image)) + (move "Filed/Images") + (stop)) + +(rule "documents" + (when (type document)) + (move "Filed/Documents") + (stop)) + +(rule "spreadsheets" + (when (type spreadsheet)) + (move "Filed/Spreadsheets") + (stop)) + +(rule "presentations" + (when (type presentation)) + (move "Filed/Presentations") + (stop)) + +(rule "archives" + (when (type archive)) + (move "Filed/Archives") + (stop)) + +(rule "audio-video" + (when (or (type audio) (type video))) + (move "Filed/Media") + (stop)) diff --git a/examples/invoices.conf b/examples/invoices.conf new file mode 100644 index 0000000..9fca018 --- /dev/null +++ b/examples/invoices.conf @@ -0,0 +1,33 @@ +;; -*- mode: lisp -*- +;; vim: set ft=lisp : +;; +;; invoices.conf — file invoices by content, into a folder per year. +;; +;; Demonstrates: (content ...) matching text pulled out of PDFs and other +;; documents (see krino.conf(5), CONTENT EXTRACTION), and the {mtime:%Y} +;; placeholder in a (move ...) destination. +;; +;; 0000000000 below is a placeholder, not an issued Polish NIP — no such +;; number is ever assigned. The conditions in (when ...) must all hold, and +;; one (content ...) is true when any of its keywords appears, so the rule +;; needs a keyword AND the number. Replace the number with your supplier's +;; or your own NIP to narrow the rule to that tax number, or delete the +;; (content "0000000000") condition to match on keywords alone. +;; +;; 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 "~/Downloads") ; CHANGE THIS to the directory to sort + +;; Leave partial downloads and dotfiles alone. +(ignore "*.part" "*.crdownload" "*.aria2" ".*") + +(rule "acme-invoices" + (when (type document) + (content "faktura" "invoice") + (content "0000000000")) ; 0000000000: fake NIP, see above + (move "Filed/Invoices/{mtime:%Y}") + (stop)) diff --git a/examples/old-installers.conf b/examples/old-installers.conf new file mode 100644 index 0000000..6ad63e7 --- /dev/null +++ b/examples/old-installers.conf @@ -0,0 +1,26 @@ +;; -*- mode: lisp -*- +;; vim: set ft=lisp : +;; +;; old-installers.conf — clean up old installers with (age ...) and (delete). +;; +;; Demonstrates: (type package), (age ...) by modification time, and +;; (delete) — which moves a matched file to the desktop trash +;; ($XDG_DATA_HOME/Trash), NOT a permanent delete; recover a mistake from +;; there. Use (delete permanent) instead only if you really want an unlink +;; that undo cannot reverse — see krino.conf(5), ACTIONS. +;; +;; 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 "~/Downloads") ; CHANGE THIS to the directory to sort + +;; Leave partial downloads and dotfiles alone. +(ignore "*.part" "*.crdownload" "*.aria2" ".*") + +(rule "old-installers" + (when (type package) + (age > 90d)) + (delete)) diff --git a/examples/screenshots.conf b/examples/screenshots.conf new file mode 100644 index 0000000..6532bab --- /dev/null +++ b/examples/screenshots.conf @@ -0,0 +1,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)) |
