Tuesday, September 25, 2012

I'm Feeling Lucky...

This evening, I took a short break from the powering through the tedium of getting through a mountain of course work, and implemented a little fun feature in the experimental file browser I've been building as part of one of my ongoing projects this year (more will be revealed about this later, possibly towards the end of November after I recover from thesis writing crunch related to this ;)


In a partial homage to Google's famous button (but really born out frustration during a few late-night procrastination sessions), there is now a file browser that will pick and navigate to random locations within your file system upon your command!



What practical use does this have?
First, you must define practical. If you mean, getting productive work done (i.e. trying to efficiently find a particular target), then this will most certainly fail that test. However, if you have a bit of spare time on your hands (or perhaps not, but ... erm... the alternative is ... umm... something you'd rather think about "later"), or perhaps just curious about what strange junk you've accumulated on your hard drive, then this is perfect.

For example, in the image above, I've got a bunch of folders with short little melodies that came to mind on particular days, which I've gone and put into a separate folder per day. Similarly, you might have a similar set of folders for your photo collection. Now, from time to time, you'd like to randomly pick one of these and have a look at what you did at a certain point in your past (i.e. sifting through old projects, and surprising yourself with little gems that you'd forgotten, or conversely, discovering how crap you were back then :P)

Now, to do this using a traditional file browser, you'd have to either start aiming erratically and clicking on anything the computer lets you. However, this means you're limited to one screenful (without resorting to scrolling, but scrolling takes effort!).  Or, you could fire up a random number generator or set of dice, and go that way. But all of this sounds like a lot of work... something that, in a haze of boredom and lethargy, is not really worth it, so you go back to watching cat videos.

With this tool, all you need to do is press Shift-B (aka Shift-Boredom-outta-the-way), and the system randomly picks one of the files or folders to "open" (i.e. same as you manually double-clicking on a folder) from the current view. Easy!

Just one word of caution though: do not attempt to use this on your Downloads or tmp directories (or if you do, exercise caution)! Years ago as a kid, I was going through one of the temp directories on one of my old computers to clear it out, when I accidentally double-clicked on an item in there. Bam! For the next few weeks, you'd have to wait 1-2 hours after booting up the computer before it'd become usable (until I learnt how to use msconfig to disable the offending culprit from the startup list).

About the rest of the file browser...
Now, for the keen eyed out there, there are a few other interesting aspects to this file browser which I've shown here, though they're mostly all just secondary bells and whistles I added for my own usage rather than the core purpose of the prototype (aka scratching some particular itches I've got with the current file browsers).

The first thing you might notice is that for once, there's a file browser that puts "Open in Terminal" front and center (well, if you don't count Dolphin, which has a big embedded command-line region which is prone to problems with long-running processes, and other problems of its own). Many of the others out there require holding obscure combinations of keys (or hacking the registry in about 5 places), installing and configuring and extension, or have the option nested in a difficult to reach and weirdly placed sub-menu of a popup. Programmers and computer-literate people rejoice!

The second is the "Copy Folder Path". Now, I'm sure you know that it is possible to click on the location bar (clicking just long enough, in the right place, and with the right phase of moon while chanting a string of swear words for it to catch) before then telling it to copy that path. Well, let's just do that in one go, shall we :) A similar feature exists for the path to a file. As anyone who's tried to figure out the arguments to pass to a one-off comandline invocation of some program with deeply nested files in some remote location will know the tedium of not having this.

You may have also wondered why all the folders were gray. Well, now that is getting into the territory of some of the things the prototype was actually built for. This second screenshot may give you a hint about what's going on here.

Figured it out yet?



Here's a hint: in the last few hours (*), I was busy building a new rig, while yesterday I was writing an article on some new features I've been working on.
(*) relative to when the dataset this is showing was captured, since the prototype currently requires complete snapshots of file system hierarchies for efficiently doing the things it does. However, by doing so, we run into the "Curse of the Cache", whereby we now have to figure out how to keep that cache in sync with the actual filesystem if we want any hope of trying to use this prototype in production/everyday usage. Nifty solutions for this problem are welcome!

Anyways, this is literally just the tip of the iceberg in terms of what this tool actually has. A hopefully very-useful iceberg.

No comments:

Post a Comment