-
Notifications
You must be signed in to change notification settings - Fork 0
/
.fu.conf
61 lines (54 loc) · 1.97 KB
/
.fu.conf
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
;; -*- scheme -*-
(cond-expand
(chicken-4
(void))
(chicken-5
(import (chicken format)
(chicken pathname)
(chicken process)
(chicken process-context)))
(else
(error "Unsupported CHICKEN version.")))
(fu-editor
(lambda (file)
(system (sprintf "emacs -nw ~a" (qs file)))
(print-selected-file file)))
(define home
(let ((dir (get-environment-variable "HOME")))
(lambda (path)
(make-pathname dir path))))
(load (home "Projects/From-Other-People/fu/goodies/grep.scm"))
(load (home "Projects/From-Other-People/fu/goodies/ignore-dot-git.scm"))
(load (home "Projects/From-Other-People/fu/goodies/ignore-emacs-backups.scm"))
(load (home "Projects/From-Other-People/fu/goodies/ignore-file-extensions.scm"))
(ignore-file-extensions '("o" "so" "jlc" "pyc"))
(define-command 'm
"m <f options> <pattern>
Find & play music."
(let ((player (lambda (file)
(system (sprintf "mplayer ~a" (qs file))))))
(fu-find/operate player
dir: (home "musicas")
multiple-choices?: #t)))
(define-command 'o
"o <f options> <pattern>
Find & open files."
(let ((opener
(lambda (file)
(let ((ext (pathname-extension file)))
(if ext
(let* ((ext (string->symbol (string-downcase ext)))
(program
(case ext
((html htm) "firefox")
((avi mpg mpeg mp3 mp4 mov) "mplayer")
((pdf) "mupdf")
((txt) "less")
((wav) "play")
((egg) "cat")
((png jpg jpeg) "display")
(else
(die! "Don't know how to open ~a files." ext)))))
(system (sprintf "~a ~a" program (qs file))))
(die! "Don't know how to open ~a." file))))))
(fu-find/operate opener)))