aboutsummaryrefslogtreecommitdiff
path: root/readme.md
blob: bcc4d4514655d6bed2a4ce01f19b68f421aa2b22 (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
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
# paste manager

A simple script to create a menu driven database for storing little bits of
information. The database is a double colon delimited plain text file
queried with standard unix tools.

This is *NOT* for passwords. Do *NOT* use it for them. See my own
[`dpw`](https://git.riedstra.dev/mitch/dpw/about/) or
[pass](https://www.passwordstore.org/) for a solution there.

Output is controlled via a small c program called `pm-fmtdb`, see the top
of the file for adjusting the format.

Works best with `dmenu` fuzzy finder patch. Utilizes list mode by default.

Menu format can easily be customized by editing the script near the
top of the `pm` shell script.

Database format is fairly simple:

```
ID::Created::Updated::Name::Content
```

It's a menu driven application with no CLI options, users are encouraged to
write programs that directly talk to the database, or extend it to suit their
needs.

## Demo video

<video width="800" height="450" controls>
  <source src="https://git.riedstra.dev/mitch/pm/plain/demo.mp4?h=video">
</video>

## Installation

```
# make install
```

You'll need `dmenu` installed. You may also wish to bind a hotkey to run the new
`pm` command


## Configuration

Environment variables:

`XDG_SESSION_TYPE` if set to `wayland` will utilize `wl-copy` from the
`wl-clipboard` package and `wtype` instead of `xclipboard` and `xdotool`
respectively. `bemenu` is used in place of `dmenu` on Wayland as well.

`PASTE_MANAGER_FILE` can override the file location
`PASTE_MANAGER_LINES` overrides the number of lines displayed by `dmenu`
`PASTE_MANAGER_X_SELECTION` sets the clipboard selection, you probably want to
leave it set to clipboard, the default. ( xorg only )


Edit the source code for further tweaks. The one people may have the most
interest in is the format sent to `dmenu`, that's controlled via the small c
program 'pm-fmtdb' near the top of the file.


### MacOS

You'll need a [menu](https://github.com/chipsenkbeil/choose), and you'll
probably want a [hotkey daemon](https://github.com/koekeishiya/skhd).

## Bugs

Probably. This was written in just a few hours. Email me if you find any, I'll
fix them.

## Not-bugs

Multi line snippets are entirely unsupported.