Friday, July 16, 2010

snippets

It's summer time and the living is ... hectic! I'm back from Akademy, which was amazing (more on that in the days to come), and my schedule is packed to the brim and then some. The list of KDE and Plasma related activities on my plate is a bit astounding, but it's all scheduled up now and feels manageable. I've even set aside 30 minutes a day for blogging again, so you can expect to see regular updates here again.

On top of that, P. and I have been enjoying the summer: yesterday we went biking down along the ocean stopping at various beaches between Kits and Jericho as we went. A pit stop for ice cream was also required, of course! Round trip was about ten kilometers, but it felt more like one as we sailed along the pathways and streets of Kitsilano next to white sand beaches under a beautiful summer afternoon sun. I'm finding that ten (which is how old P. is these days) is a great age: increasingly independent and able to keep up, but still wants to hang out with his dad. ;)

I've also been working in my evenings/weekends (because I don't have enough to do these days, right?) on a Super Sekrit Projekt(tm) with my good friend Zack and it's nearing fruition. Some who were at Akademy would have caught my hallway presentation of it, and we're gearing up for a release before 2010 is done.

I did the usual "step back and check out the upcoming SC release" the other day, using Plasma Desktop and various KDE Applications from the 4.5 branch next to P.'s laptop running version 4.4 of the KDE software compilation. A number of big and little annoyances jumped out at me in the 4.4 version as I started using both; the 4.5 release is going to be a big step up in terms of completeness and polish. Kudos to everyone who has been working on it!

A flurry of activity has already started for the 4.6 development cycle, with Google Summer of Code projects getting to mergeable states and trunk open again for feature commits now that SC 4.5 is into the release candidate phase. I have an upcoming blog (3, actually) about Plasma in SC 4.6 so I won't go into too much detail about it right now. I did manage to find a bit of time yesterday after lunch to sit down and do something that I wanted to have. It's a bit funny but these days I don't do many features "just for me", but it's nice to find time for that once in a while still. So what did I do?

Well, I use the Javascript-powered desktop scripting console quite a bit.



(You may notice that there's a mouse cursor in that snapshot! KSnapshot in SC 4.6 will support grabbing the mouse cursor, which is a feature that was submitted by one of our enthusiast users via bugs.kde.org. Huzzah!)

I find that the desktop console is a great way to tweak things in the desktop quickly and test configuration changes on the fly. In SC 4.5, it now autosaves/loads the last script you are working on which is quite handy. But I often want to switch between different scripts I have sitting around. You can indeed load scripts from disk by either supplying the path to krunner when opening the desktop scripting console or using the Open button in the console's toolbar. I wanted something better, though. I wanted snippets.

In SC 4.5 we already have the ability to create layout templates using Javascript. These templates are bundled up in little Plasma packages. The plasmapkg helper app understands the package type "layout-template" in support of this, meaning you can easily install, remove and update template packages. Do you see where I'm going with this yet? (I bet you do! :)

(As an aside, when I read Matt Zimmerman's blog entry on divide-and-conquer as an approach to packaging I found myself nodding and thinking, "Yeah, that's exactly what we're doing!" :)

So here's what I ended up with after ~15 minutes of hacking:



All installed Javascript layout packages appear in the Snippets menu in the toolbar. Select one and it is loaded into the console for you to tweak and try. To complete the effect, I'll be adding:


  • export the current script as a layout template package

  • save changes made in the console to the layout template that was loaded

  • share templates with other users via kde-apps.org



Each of those items will take less than an hour of work, so should fit neatly into those little pockets of "I need to scratch an itch!" time that pop up every so often. This probably won't be a feature most of our users care about, or even ever see, but I know it's a feature that I'll be using on a regular basis. :)

5 comments:

Nece228 said...

As i see in krunner screenshot on bottom rounded edges i no longer see ugly black squares. so this means that finally after 6 months you have resolved it?

Diego said...

Well, I think saving desktop and panel configuration is a must have. At the moment "fucking up you desktop" for a normal user is too simple: you just need to right click on the panel and click for error on "remove task bar" or "remove panel". You get into a really awful state, and you cannot easily get back. Saving panels or restoring defaults is a must have.

Aaron J. Seigo said...

@Nece228: i never had that problem at all. i do believe that it is resolved, though, for those who were affected by it.

@Diego: that's a rather different set of issues, actually. and restoring defaults, at least for the panel, is already there in SC 4.5.

and of course clicking "remove panel" asks for confirmation before doing so. there really is only so much one can do to save people from themselves ;)

Ramsees said...

What would be nice is that you could undo changes done to the panel, like an "undo" menu entry, that would kick ass.

Jaye said...

While I have loved all the stages my kids have been through (ok..not the mid teens! lol) I DO truly love the ages P and B are at, just like YOUR P! 11 and 9...and 10..all good ages!
Love you!