bio blog

Introducing Dirculese, a Desktop Organizer Written in Go

11/4/2018

Earlier this year, I started working with Go, a programming language developed by Google engineers Robert Griesemer, Rob Pike, and Ken Thompson. Go was released in 2012 and is a statically typed, compiled language, with memory safety, garbage collection, and built-in concurrency. Go compiles so quickly that you soon forget compilation is even a thing.

My first experience with Go was so rewarding that I decided to dive a little deeper and address a longstanding pain point. I am constantly saving things to my desktop: pdf files, screenshots, excel documents, email attachments -- the items are wide and varied and I need them in immediate view, say to drag-and-drop into an email window or upload into a ticket. At the end of the day, I want everything off of my desktop, but I want images to go into one folder, documents into a second, spreadsheets into a third, etc. This clears my desktop but archives the items into semi-manageable groups. I hate doing this manually, and much to my surprise, I had a hard time finding a piece of software that took care of it. What I did find was platform specific and (sometimes) worked on my Mac but not on my Linux or Windows machines. Boo!

And so in a nutshell, dirculese organizes your directories so you don't have to.

Installation and setup are simple (of course, you'll need to install Go first).

Install dirculese like so:

go get github.com/moismailzai/dirculese

Then create a .dirculese.json file in your user home directory. Here's what mine looks like:

{
  "Directories": [
    {
      "Path": "/Users/mo/Desktop",
      "Rules": [
        {
          "Target": "/Users/mo/Desktop/img",
          "Delete": false,
          "Handler": "ExtensionHandler",
          "Extensions": [
            "png",
            "jpg",
            "jpeg",
            "gif",
            "svg",
            "webp"
          ],
          "SizeMax": 0,
          "SizeMin": 0,
          "DateMax": 0,
          "DateMin": 0
        },
        {
          "Target": "/Users/mo/Desktop/doc",
          "Delete": false,
          "Handler": "ExtensionHandler",
          "Extensions": [
            "doc",
            "docx",
            "psd",
            "sketch",
            "xls",
            "pdf"
          ],
          "SizeMax": 0,
          "SizeMin": 0,
          "DateMax": 0,
          "DateMin": 0
        },{
          "Target": "/Users/mo/Desktop/noext",
          "Delete": false,
          "Handler": "ExtensionHandler",
          "Extensions": [
            ""
          ],
          "SizeMax": 0,
          "SizeMin": 0,
          "DateMax": 0,
          "DateMin": 0
        }
      ]
    }
  ]
}

My configuration only has a single managed directory in it, my desktop, and three unique rules managing it -- but dirculese can handle as many directories and rules as you want.

The last step is simply to call dirculese from the command line and watch it clean up your dirty life.

To learn more, checkout the project on Github!