-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbucket.1
211 lines (211 loc) · 5.27 KB
/
bucket.1
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
.TH BUCKET 1
.SH NAME
bucket \- a clipboard manager or registers for the shell
.SH SYNOPSIS
command | \fBbucket\fR [\fIOPTIONS\fR] [\fIBUCKET\fR]
.PP
\fBbucket\fR [\fIOPTIONS\fR] [\fIBUCKET\fR] [\fIDATA\fR]
.PP
The first form reads data from \fISTDIN\fR and writes to the default bucket, or \fIBUCKET\fR if given.
The second form reads \fIDATA\fR and/or \fIBUCKET\fR from arguments, writing to a bucket or printing a bucket's contents.
.SH DESCRIPTION
\fBbucket\fR is like Emacs/Vim-style registers for the shell.
It makes it easy to save clips of text to named "buckets" (or a default, unnamed bucket) and access them later.
.SH OPTIONS
.TP
\fB\-a\fR, \fB\-\-append\fR
Append to bucket
.TP
\fB\-d\fR, \fB\-\-date\fR
Sort by date
.TP
\fB\-e\fR, \fB\-\-edit\fR
Edit bucket
.TP
\fB\-E\fR, \fB\-\-empty\fR
Empty bucket
.TP
\fB\-g\fR \fIPATTERN\fR, \fB\-\-grep\fR \fIPATTERN\fR
Grep in buckets
.TP
\fB\-h\fR, \fB\-\-help\fR
i can Haz cheezburger?
.TP
\fB\-l\fR, \fB\-\-list\fR
List buckets
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Verbose output
.TP
\fB\-V\fR, \fB\-\-VERBOSE\fR
VERY verbose output
.TP
\fB\-x\fR, \fB\-\-expire\fR
eXpire old buckets (default: +14 days)
.TP
\fB\-\-directory\fR \fIDIRECTORY\fR
Bucket storage directory
.SH EXAMPLES
Pour into default bucket by argument:
.PP
.nf
.RS
$ \fBbucket\fR "I wondered why the frisbee was getting bigger, and then it hit me"
.RE
.fi
.PP
Pour from default bucket:
.PP
.nf
.RS
$ \fBbucket\fR
I wondered why the frisbee was getting bigger, and then it hit me
.RE
.fi
.PP
Pipe default bucket into named bucket:
.PP
.nf
.RS
$ \fBbucket\fR | \fBbucket\fR jokes
.RE
.fi
.PP
Pipe into named bucket, verbosely:
.PP
.nf
.RS
$ dmesg | grep error | \fBbucket\fR -v errors
[ 7.817768] EXT4-fs (sdc1): re-mounted. Opts: errors=remount-ro,user_xattr
.RE
.fi
.PP
Pour from named bucket:
.PP
.nf
.RS
$ \fBbucket\fR errors
[ 7.817768] EXT4-fs (sdc1): re-mounted. Opts: errors=remount-ro,user_xattr
.RE
.fi
.PP
Append to a bucket by argument:
.PP
.nf
.RS
$ \fBbucket\fR -a jokes "A plateau is the highest form of flattery."
$ \fBbucket\fR jokes
I wondered why the frisbee was getting bigger, and then it hit me
A plateau is the highest form of flattery.
.RE
.fi
.PP
List buckets:
.PP
.nf
.RS
$ \fBbucket\fR -l
bucket errors jokes
.RE
.fi
.PP
List buckets verbosely (just the first line of each bucket):
.PP
.nf
.RS
$ \fBbucket\fR -lv
bucket: I wondered why the frisbee was getting bigger, and then it hit me
errors: [ 7.817768] EXT4-fs (sdc1): re-mounted. Opts: errors=remount-ro,user_xattr
jokes: I wondered why the frisbee was getting bigger, and then it hit me
.RE
.fi
.PP
List buckets completely:
.PP
.nf
.RS
$ \fBbucket\fR -lV
bucket:
I wondered why the frisbee was getting bigger, and then it hit me
errors:
[ 7.817768] EXT4-fs (sdc1): re-mounted. Opts: errors=remount-ro,user_xattr
jokes:
I wondered why the frisbee was getting bigger, and then it hit me
A plateau is the highest form of flattery.
.RE
.fi
.PP
Grep buckets:
.PP
.nf
.RS
$ \fBbucket\fR -g frisbee
bucket:I wondered why the frisbee was getting bigger, and then it hit me
jokes:I wondered why the frisbee was getting bigger, and then it hit me
.RE
.fi
.PP
Edit buckets (using \fI$EDITOR\fR):
.PP
.nf
.RS
$ \fBbucket\fR -e
Waiting for Emacs...
$ \fBbucket\fR -e jokes
Waiting for Emacs...
.RE
.fi
.PP
Empty buckets:
.PP
.nf
.RS
$ \fBbucket\fR -E
$ \fBbucket\fR
$ \fBbucket\fR -E jokes
$ \fBbucket\fR jokes
.RE
.fi
.PP
Expire old buckets:
.PP
.nf
.RS
$ sleep 14d # Default: 2 weeks
$ \fBbucket\fR -x
$ \fBbucket\fR -l
.RE
.fi
.SH CONFIGURATION
.B
Empty/expire commands
.RS
The default command for \fI\-\-empty\fR and \fI\-\-expire\fR is \fItrash-put\fR, part of the \fItrash-cli\fR package,which may not be installed on your system by default.
\fItrash-cli\fR is a great package, so I recommend installing it. It uses the standard XDG trash bin from the terminal.
.PP
If you prefer, you can easily change the default to \fIrm\fR by changing the \fIdeleteCommand\fR variable near the top of the script.
.PP
Or you could change it to something like \fImv -t ~/.local/share/Trash/files\fR, although that might cause the trashed files to not show up in GUI trash apps, since they would be missing the \fI.trashinfo\fR files.
.PP
.RE
.B
Storage directory
.RS
The default directory for bucket storage is \fI~/.cache/bucket\fR.
\fI~/.cache\fR is probably excluded by most backup programs (it should be), so this seems like a good place for buckets, since buckets are intended to be temporary storage.
.PP
However, you can set a custom directory using the \fI\-\-directory\fR option.
Unlike the default directory, it will not be created for you if it doesn't exist.
You might set this option in an alias, that way whenever you use that alias, the buckets would be stored in that directory.
This could be helpful if you wanted to store a certain set of buckets more permanently, in a place where they would typically be included in backups.
.SH SEE ALSO
For more amusing info, see the readme file at \fI/usr/{local,}/share/doc/bucket/README.org\fR
.SH DEVELOPMENT
I can't think of much else to add right now.
But I welcome suggestions and pull requests.
Bug reports may be kept to yourself (just kidding).
.PP
\fBbucket\fR's home is at \fIhttps://github.com/alphapapa/bucket\fR.
.SH LICENSE
I really don't think a license is necessary for something this straightfoward.
But consider it GPL'ed.