Friday, August 22, 2008

Busy and Still (!) Hacking

It never ceases to surprise me how life has its little twists and turns, often in an unexpected direction. I'm still working on fixing up my house, which is funny, because I had originally planned on having it all done and my house being put on the market by the end of June. Boy, I have to laugh about how far off even our best-laid plans can be. God must have something else in mind, but being He knows best, I'm not really worrying about it. The school year started for the teachers this past Wednesday, so I've had significantly less time for fun stuff, but even then, I've made some time to unwind by sitting down and hacking some code for a bit.

Since last time, I've spent more than a little time attempting to finish up the other project that I've mentioned this summer -- an application bundling program. The concept? To the user, the program is just one file; delete it and you've uninstalled a program. Installation is as simple as downloading it from the Internet. The only downside to this method of packaging programs is the size of the file. The BFS filesystem forces packages to be at least about 1.5MB for even something small like Mr. Peeps or Run Program. With hard drive storage being so cheap and the unlikelihood that someone will have as many program bundles as MP3s, I figure it's not that big of a deal except when downloading. The solution? Compress them, which they do very nicely.

There is one problem, however. In testing a Filer rule for uncompressing and installing zipped bundles, I ran into some very strange instances where if I zipped a bundle and then turned around and unzipped a new, theoretically exact duplicate of the original, the original would run just fine but the new one wouldn't. I even compared CRC32 signatures with perfectly matching results. The conclusion? Something doesn't work so well under R5. I get some totally different error messages in Haiku, so a bug report is probably in order there. If any of you more technical readers would be willing to do a little testing under Zeta or Dano, I'd genuinely appreciate it. E-mail me or leave a comment. In any event, the program bundling is on the back burner for the moment, leaving me time to work on my final R2 project of the summer: the Deskbar.

In my R2 desktop proposal, I described changing the Deskbar to make it more functionally useful and better organized. All the details can be boiled down to breaking the Be menu into three and making the Deskbar behave a little more like a panel used in Linux, with addon widgets for things like inbox monitoring, weather, and other useful tools. I've started it and made much more headway than I thought I would. I was intimidated by the Deskbar code, which is mature, stable code which more complicated, architecturally speaking, than I'm used to dealing with. After some code study, though, it isn't nearly as difficult as it looks.

How far have I gotten? Well, I have all three menus implemented: Programs, Computer, and Bookmarks. Integration of NetPositive bookmarks is complete, and would be wildly convenient if I had a decent browser to use them with (might try NetSurf). No more broken Deskbar links, either -- applications are found by query and there is an almost-imperceptible delay when browsing the menu. The system settings program (screenshot in an earlier post) drastically reduces the clutter in the Computer menu. The Bookmarks menu doesn't create bookmarks when you drop files on it yet, but that's currently being investigated. Overall, I really like it, and I can't wait to get it to the point where I can replace the Deskbar on my machine with it. That day will come, and it will be a good one. No screenshots yet -- I'm also working on some nice icons to replace the cruddy placeholder ones I currently have in place. Stay tuned!

Tuesday, August 12, 2008

Another Little Project Launch: Run Program

The box I used this summer to do all my BeOS development died Sunday. Kaput. For little apparent reason, the motherboard went. I had a feeling that it would, considering that it would randomly reboot without cause. By the grace of God I backed up all my files right before it went, so I lost nothing. I installed Max Edition 4 on a spare machine that I has mistakenly thought was dead and was intrigued by a little app in the Deskbar titled Run..., written by Luke A. Kanies, which is the BeOS counterpart to the Windows Run window. It's OK, but it lacks path information, so it requires you to type in everything. That's a lot of work. For some reason I thought, "You know, it wouldn't take much to add autocompletion to that." Sure enough, the autocompletion code I wrote for Capital Be was easily reused and Run Program was born.

I like Windows' Run window because you can hit Win+R and run explorer, regedit, and other apps. It certainly saves hunting the Start Menu. One of the few features that Vista introduced that I liked was the ability to search the Start Menu. Type in a few letters and you have the program you want. Run Program combines the two -- start typing and you can start a program in the Deskbar or do a quick Terminal command. I bound it to a quick key combination using SpicyKeys and now I can run just about any program (StyledEdit comes to mind) without using the mouse. Considering how twitchy my mouse is, that's a good thing. You can find this on BeBits and Haikuware. Who knows? Maybe someday I may extend it to act more like Enso.

Thursday, August 7, 2008

Talk about Turnaround... Filer Beta 2 is Out

Today sure has been busy, but in a good way. I spent last night and this morning putting together a new bed frame for my daughter (some assembly required... yeah, sure), so I was a little surprised that some people found a serious crash bug and that I my efforts were mentioned on BeOSNews. Consider me flattered. :-) After attempting to come up with some other neat uses for the Filer, I thought of a couple more features to add, started hacking away, and even found and fixed a couple more bugs. Beta 2 is out on BeBits and Haikuware.

The second beta adds some niceties that I thought would be really useful. If you send the Filer a symlink, it treats the link as if the real file were sent to it from the link's location. In other words, if I have a link to a file on the Desktop and I send the link to the Filer, it treats the file as if it really were on the Desktop. The Open command fires up the file's default application, and you could set up a simplistic form of backups with the Add to Archive command. One thing that I thought would be really useful (alas, wput doesn't exist for R5 :( ) would be to have the Filer automagically turn one of my project development folders into a zipfile and upload it to my old website. It certainly would make releases a little faster. I also added the %FOLDER% substitution pattern. Sometimes you want the folder a file is in and not the file itself. :)

It's kind of all a blur at the moment, but if I remember correctly, someone asked me how exactly you could use it to organize your MP3s for you when used with id3attr. Here's a rule to do it all:

Name ends with .mp3
Terminal command: id3attr '%FULLPATH%'
Rename it to: %ATTR:Audio:Artist% - %ATTR:Audio:Title%.mp3
Move it to: /boot/home/music/%ATTR:Audio:Artist%

Note that the %FULLPATH% section in the Terminal command has single quotes around it. This makes sure that things like spaces don't mess things up. If you also wanted to play it after it was sorted away, add an 'Open it' action at the end.

All in all, not bad for a day's work. TTFN :)

Wednesday, August 6, 2008

Filer 1.0 Beta 1 Released!

I haven't released any new software in such a long time that I forgot how exciting a time it is. I just got done posting the release to BeBits and Haikuware. Last night I was hacking away at it, and when I finished, I thought, "oh, wow, this is cool!" I certainly haven't had a moment like that in a long, long time.

One of the really neat things about it is being able to grab Axel's id3attr from BeBits (that creates attributes from MP3 tags) and use the Filer to organize an MP3 library. You can do this because of pattern substitutions and the ability to use bash commands. Pattern substitutions are a feature in cd ripping software where you can set a format for a file name, such as writing in %A - %T.mp3 to have the software make files with names like Skillet - Savior.mp3 and Big Tent Revival - Two Sets of Joneses.mp3. Unzipping a Zip file to the Desktop is as simple as one command: unzip '%FULLPATH%' -d /boot/home/Desktop. %FULLPATH% substitutes the full path of the file being processed before the command is executed. I listed some other examples in the help file bundled in with the executable.

If you come up with a really neat rule, put it in the comments or e-mail me and I'll put it up to share with everyone. Enjoy!

Monday, August 4, 2008

Project Progress (3 of 4): The Filer

With all the updates in a short time and then nothing, you'd think that I just didn't have time to do anything. You'd be wrong, for once. I mentioned in my last post that I'd be getting back on the 31st, which I did. Once I returned home, I went into a flurry of code the likes of which I haven't seen in years. In fact, on more than one occasion I did some late night or very early morning code sessions, with some nice, concrete results this morning at about 5AM. The results? The third of my four summer R2 projects: the Filer.

Unlike many other ideas that were in my original Desktop RFC on the Haiku website, this one did not change much, so the info is pretty close to what is in the revised -- and still yet unpublished -- version. You can find more detail on the Filer by following the link, but to quickly summarize, it's a program to let you automatically organize your files according to a set of rules that you create. The idea has actually been around for quite a while, but I only heard of the only two implementations this summer: Belvedere, a freeware Windows app well-known to Lifehacker readers, and the original which inspired it, Hazel, an incredible shareware OS X app from Noodlesoft. The difference from these two is that -- hopefully -- mine will be integrated with the OS, offloading one more task for the user when he wishes.

Filer development, simply put, has been long and difficult, which is why it's taken so long before I mentioned anything about it. It's probably the biggest "little" app I've written, so I want to do more testing and fixing before releasing it. There are other features planned, but it has the essentials and with two weeks before school starts, I want to make sure the last project gets done or at least most of the way done. As is my habit, here is a screenshot to keep you going: