Clippy: clipboard history tool

My clipboard history is one of my most valuable tools. I use it extensively while coding, writing emails, etc. I used it while writing this post! If you are a coder, I really think it can make a nice improvement to productivity.

I’ve been using ArsClip for a long time, something like 10 years. I even donated multiple times. After some frustration with the latest versions and wishing that search was easier, I finally decided to write my own minimalistic clipboard history tool. Thus, Clippy was born!

Clippy is a clipboard history tool for Windows. It uses Java of course, with JNA for the Windows specific parts and an H2 database to store any text items that are copied to the clipboard. The stored text items can be easily retrieved by browsing or searching.

Bug (line 381) - swap if statements.


			else if (dataType.startsWith("TIME"))
				type = Types.TIME;
			else if (dataType.startsWith("TIMESTAMP"))
				type = Types.TIMESTAMP;

Nice, good catch Riven! What do you think of DataStore? It doesn’t hide that SQL is being used, but it makes it super easy to setup and use an H2 database in a thread safe way. A long time ago I had another layer on top of it that was basic ORM, but that gets nasty pretty quick.

Can I have it for Mac please?

Kev

offtopic:

I have an abstraction layer that is actually pretty nifty, without forcing you into ORM. (there is an ORM layer I built on top of it, but it’s optional)

It mostly revolves around named parameters:


Set<Integer> bestFriendIds = new HashSet<>();
bestFriendIds.add(13);
bestFriendIds.add(14);
bestFriendIds.add(37);
// or: int[] bestFriendIds = new int[]{13,14,37};

Query q = new Query(); // builder pattern-ish
q.withSQL("SELECT [whatever:w], [sumfin:s]    ");
q.withSQL("  FROM whatever AS w               ");
q.withSQL(" INNER JOIN sumfin AS s            ");
q.withSQL("         ON w.id = s.fk            ");
q.withSQL(" WHERE w.id IN ( :ids )            ");
q.withSQL("   AND age < :age                  ");
q.withParam("ids", bestFriendIds);
q.withParam("age", 55);
resultset = q.execute();

Is expanded to:


SELECT w.id, w.user, w.email, w.age,  <-- fixed column order, allowing for
       s.id, s.quirk, s.isDuke        <-- high performance: resultset.get(++columnIndex)
  FROM whatever AS w
 INNER JOIN sumfin AS s
         ON w.id = s.fk
 WHERE w.id IN (?, ?, ?)              <-- notice the variable amount of parameters, determined by Collection.size()
   AND age < ?

where the parameters are converted/transformed and shoved into the PreparedStatement.

Would I open-source it? Nevah! No time to give support to mere mortals! :emo:

Sounds like you need the DAMAIL: https://github.com/nslater/DAMAIL

I just ripped out the column definition parsing stuff completely, since it was only there for the ORM stuff.

For OS X the JNA would need to be figured out for system-wide keyboard hooks, a system tray icon, and clipboard monitoring and manipulation. That stuff shouldn’t be terribly hard, but I find working on OS X pretty painful (extremely painful). Contributions are welcome! :smiley: For OS X try:
http://www.clipmenu.com/

Also the best alternative to Clippy on Windows is Ditto:
http://ditto-cp.sourceforge.net/
Ditto seems a lot more configurable than ArsClip and does search better. Both have lots of features that I’m not interested in though. Clippy is Java and much simpler, which makes it easier to make it do (and look) exactly what I want. I think contributing to Ditto would relatively difficult, it being such a large C++ project.