annotate README.txt @ 14:a62fbff067f8

start bringing this whole thing up to speed
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 01 May 2013 06:56:12 -0700
parents 7328744920de
children 12db2d46722d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
1 smartopen
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
2 =========
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
3
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
4 smartopen is a command line program that will transform text according
14
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
5 to handlers to URLs and open them
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
6
5
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
7
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
8 Usage
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
9 -----
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
10
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
11 ``smartopen --help`` displays the program usage:
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
12
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
13 """
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
14 Usage: smartopen [options]
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
15
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
16 Options:
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
17 -h, --help show this help message and exit
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
18 -c CONFIG, --config=CONFIG
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
19 config file to read
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
20 -u, --url print the first url handled
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
21 -a, --all print all handlers that match the query
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
22 -H HANDLERS, --handler=HANDLERS
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
23 name of the handler to use, in order
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
24 --print-handlers print all handlers in order they would be tried
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
25 """
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
26
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
27 smartopen reads text from standard input or command line arguments.
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
28 The handlers are then iterated through in a configurable order and, if
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
29 the handler can transform the text into a URL, the URL is then
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
30 processed. Unless otherwise specified by command line options
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
31 (e.g. --url, --all), the first matching URL is then opened in firefox.
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
32
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
33
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
34 Handlers
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
35 --------
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
36
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
37 smartopen has a pluggable system of configurable handlers. The
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
38 setuptools entry point ``[smartopen.locations]`` is an extension point
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
39 for the handlers. Several handlers come with smartopen, or you can
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
40 write your own.
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
41
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
42 URL: a resolvable URL
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
43 Google: a google search
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
44 Wikipedia: a Wikipedia article
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
45 GoogleMaps: an address in google maps
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
46
14
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
47 etc.
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
48
5
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
49
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
50 Configuration
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
51 -------------
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
52
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
53 smartopen uses a configuration file that defines the order of the
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
54 handlers and their behavior.
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
55
14
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
56 A simple example is shown here:
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
57 http://k0s.org/hg/smartopen/file/tip/smartopen.ini
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
58
5
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
59
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
60 Interfacing With Your Environment
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
61 ---------------------------------
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
62
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
63 While smartopen is useful of its own right, its utility may be
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
64 enhanced by using as part of an environment. For instance, I run the
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
65 fluxbox window manager which allows the use of hotkeys. By binding
14
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
66 smartopen to ``Ctrl+Alt+s`` and using ``xclip``, I can open a URL that is
5
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
67 mappable to a smartopen handler with a keyboard shortcut. The
14
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
68 relevant line from my ``~/.fluxbox/keys`` file reads:
5
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
69
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
70 Control Mod1 s :ExecCommand /home/jhammel/python/smartopen.py "$(xclip -o)" # smartopen
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
71
7328744920de adding README file
k0s <k0scist@gmail.com>
parents:
diff changeset
72
14
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
73 ----
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
74
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
75
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
76 Posterity is gained...
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
77 ----------------------
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
78
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
79 I mostly wrote smartopen to help me. That it has.
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
80 However...a few things....
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
81
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
82 - better way of setting up handlers?
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
83 - really, i want to push down to choose what i think the handler is,
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
84 but only should we I release the hand that Jesus becomes Magic
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
85 (sorry, I hate the movie too)
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
86
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
87 ....and more?
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
88
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
89 Was reading about catfish....e.g.
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
90 http://www.addictivetips.com/ubuntu-linux-tips/catfish-file-searching-tool-for-ubuntu-linux/
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
91 ...
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
92
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
93 """
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
94 file search tool that support several different engines
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
95
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
96 A file search tool using different backends which is configurable via
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
97 the command line.
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
98
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
99 This program acts as a frontend for different file search engines.
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
100 The interface is intentionally lightweight and simple. But it takes
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
101 configuration options from the command line.
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
102
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
103 Currently find, locate, tracker, strigi, pinot, and beagle are
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
104 supported as backends
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
105 """.
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
106
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
107 Should smartopen....be a pluggable thing that takes text and finds
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
108 both *the handler* and *what to do with it*???
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
109
a62fbff067f8 start bringing this whole thing up to speed
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
110 I mean, short of it being a neural network anyway....