Archive

Archive for the ‘Operating Systems’ Category

Kubuntu 11.10: Mapping the Windows Key to Activate KMenu

January 7, 2012 13 comments

This post is an explanation of how to map the Windows key on a Dell Studio 17 running Kubuntu 11.10 to open the KMenu. If you, or your programs, rely on the Windows key as a Meta key for certain functionality this will break that. This is your only warning.

This is taken from the Mepis docs that can be found at http://www.mepis.org/docs/en/index.php?title=Extra_keys. I wandered around the world for a long time before I stumbled onto this wiki and it laid everything out step-by-step. I am simply listing the same steps from the Mepis Extra Keys documentation modified for Kubuntu running on my Studio 17 notebook.
Read more…

Writing an Eclipse Plug-in (Part 17): Custom Project: Customizing the Perspective Menus Using Customize Perspective

January 9, 2010 2 comments

Almost time to add submenus!

But not today. I said almost.

Today, I want to take a look at the Customize Perspective dialog, what we got for free and what we still have to do to get that final finished look.

Back in Part 15 I mentioned that we should update three things when we add a New Wizard:

  1. Main menu File menu
  2. Toolbar
  3. Customize Perspective window

In Part 15 we updated the File menu, in part 16 we updated the toolbar and now we will take a look at what needs to be done to allow us to customize the custom perspective’s version of the File menu and the toolbar.

Before we do that let’s take a look at what Eclipse gave us for free and review how a user might customize a perspective.

Start the runtime workbench, switch to the Custom Perspective and open the Customize Perspective window by doing the following:

  • Window –> Open Perspective –> Other –> Custom Plug-in Perspective –> OK
  • Window –> Customize Perspective

Click on the Menu Visibility tab.

From the Menu Structure list we can see that our three New Wizard types are already listed. If a user were to decide that they did not want to see one or more of the custom wizards they could simply uncheck the undesired types. Simply adding the items to perspectiveExtensions as newWizardShortcuts added them to the File –> New main menu, the toolbar New button and this user configuration window.

Clicking on the Command Groups Availability tab does not show us anything related to our current task.

Click on the Shortcuts tab.

The Submenus choice of New has our Custom Wizards all selected. Anything checked/unchecked here will have the same impact as the Menu Visibility tab; things will appear or disappear from the main menu File –> New submenu and from the toolbar New drop down button.

The Submenus choice of Open Perspective will display the checked item under the main menu Window –> Open Perspective submenu. Since none of the items are check none of them appear when the user selects Window –> Open Perspective (they see the ubiquitous Other).

The Submenus choice of Show View will display the checked item under the main menu Window –> Show View. Again, none are chosen so Other will be seen instead.

Click on the Tool Bar Visibility tab. Be prepared to cover your eyes; it could get ugly.

The Tool Bar Structure list shows the second entry as existing, having three entries, but no label. What happened?

Way back in the history of Eclipse, say the 3.5 release, the Platform Command Framework was introduced. It deprecated the use of the actionSets extension to both make adding commands simpler and more flexible. The recommended way of doing what we did was the way we did it: use the org.eclipse.ui.menus extension. There is only one problem: the actionSets extension is still useful and is the missing part of today’s puzzle.

Today’s puzzle: how do we give our toolbar group a label?

I’m glad you asked.

How (are we doing it?)

Let’s walk the steps to give our custom wizard toolbar commands a label.

  1. plugin.xml –>Extensions –> Add
  2. Select org.eclipse.ui.actionSets and click Finish
  3. Change label (actionSet) to:
    • id: customplugin.toolbar
    • label: Hidden Clause Toolbar Commands
  4. Save plugin.xml
  5. Start the runtime workbench
  6. Change to the Custom Perspective and go to Window –> Customize Perspective

Woo hoo! Yes, success tastes sweet.

Now use the Externalize Strings Wizard to move the string Hidden Clause Toolbar Commands to our properties file.

Why (did we do it that way?)

As you may have already guessed, not using the actionSets extension had 0 impact on the behavior of the buttons we added. None. Nada. Zilch.

That didn’t stop me from spending a few hours to track down the proper configuration to make sure that I had a respectable label for my new toolbar buttons. Why bother spending the time? Because it matters to the user even if that user is me or my most hated enemy (well, maybe not my most hated enemy).

In this case, the use of the actionSets extension just got us our label and burned part of my Saturday afternoon. The use of actionSets continues the configuration-only streak I like so much.

Hey, if I can’t burn a few hours to help spread the good word about Eclipse then what can I do?

The cat is alive and has company.

What Just Happened?

With a simple addition to plugin.xml we were able to complete a successful addition of New Wizard functionality to the main menu, the toolbar and the Customize Perspective window. I’m happy. I hope you are too (but that doesn’t matter to me so much).

Thanks

Thanks to Michael Scharf at the Eclipse and Java Blog for just the example I was looking for on how to give the Customize Perspective Tool Bar Visibility toolbar group a label using just configuration.

Reference

Every pixel counts! The new eclipse fullscreen plugin…

Code

No code! Again!

plugin.xml

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
   <extension
         point="org.eclipse.ui.newWizards">
      <category
            id="customplugin.category.wizards"
            name="%category.name">
      </category>
      <wizard
            category="customplugin.category.wizards"
            class="customplugin.wizards.CustomProjectNewWizard"
            finalPerspective="customplugin.perspective"
            icon="icons/project-folder.png"
            id="customplugin.wizard.new.custom"
            name="%wizard.name">
      </wizard>
      <wizard
            category="customplugin.category.wizards"
            class="customplugin.wizards.CustomProjectNewSchemaFile"
            descriptionImage="icons/schema-file_32x32.png"
            icon="icons/schema-file_16x16.png"
            id="customplugin.wizard.file.schema"
            name="%wizard.name.schema">
      </wizard>
      <wizard
            category="customplugin.category.wizards"
            class="customplugin.wizards.CustomProjectNewDeploymentFile"
            descriptionImage="icons/deployment-file_32x32.png"
            icon="icons/deployment-file_16x16.png"
            id="customplugin.wizard.file.deployment"
            name="%wizard.name.deployment">
      </wizard>
   </extension>
   <extension
         point="org.eclipse.ui.perspectives">
      <perspective
            class="customplugin.perspectives.Perspective"
            icon="icons/perspective.png"
            id="customplugin.perspective"
            name="%perspective.name">
      </perspective>
   </extension>
   <extension
         point="org.eclipse.ui.perspectiveExtensions">
      <perspectiveExtension
            targetID="customplugin.perspective">
         <view
               id="customnavigator.navigator"
               minimized="false"
               ratio=".25"
               relationship="left"
               relative="org.eclipse.ui.editorss">
         </view>
      </perspectiveExtension>
   </extension>
   <extension
         id="customplugin.projectNature"
         point="org.eclipse.core.resources.natures">
      <runtime>
         <run
               class="customplugin.natures.ProjectNature">
         </run>
      </runtime>
   </extension>
   <extension
         point="org.eclipse.ui.ide.projectNatureImages">
      <image
            icon="icons/project-folder.png"
            id="customplugin.natureImage"
            natureId="customplugin.projectNature">
      </image>
   </extension>
   <extension
         id="customplugin.contenttype"
         point="org.eclipse.core.contenttype.contentTypes">
      <content-type
            base-type="org.eclipse.core.runtime.xml"
            file-extensions="xml"
            id="customplugin.contenttype.schema"
            name="%content-type.name.schema"
            priority="normal">
         <describer
               class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber2">
            <parameter
                  name="element"
                  value="hc-schema">
            </parameter>
         </describer>
      </content-type>
      <content-type
            base-type="org.eclipse.core.runtime.xml"
            file-extensions="xml"
            id="customplugin.contenttype.deployment"
            name="%content-type.name.deployment"
            priority="normal">
         <describer
               class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber2">
            <parameter
                  name="element"
                  value="hc-deployment">
            </parameter>
         </describer>
      </content-type>
   </extension>
   <extension
         point="org.eclipse.ui.perspectiveExtensions">
      <perspectiveExtension
            targetID="customplugin.perspective">
         <newWizardShortcut
               id="customplugin.wizard.new.custom">
         </newWizardShortcut>
         <newWizardShortcut
               id="customplugin.wizard.file.schema">
         </newWizardShortcut>
         <newWizardShortcut
               id="customplugin.wizard.file.deployment">
         </newWizardShortcut>
      </perspectiveExtension>
   </extension>
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            locationURI="toolbar:org.eclipse.ui.main.toolbar">
         <toolbar
               id="customplugin.toolbar">
            <command
                  commandId="org.eclipse.ui.newWizard"
                  icon="icons/project-folder.png"
                  label="%customproject.label"
                  style="push"
                  tooltip="%customproject.tooltip">
               <parameter
                     name="newWizardId"
                     value="customplugin.wizard.new.custom">
               </parameter>
               <visibleWhen
                     checkEnabled="false">
                  <with
                        variable="activeWorkbenchWindow.activePerspective">
                     <equals
                           value="customplugin.perspective">
                     </equals>
                  </with>
               </visibleWhen>
            </command>
            <command
                  commandId="org.eclipse.ui.newWizard"
                  icon="icons/schema-file_16x16.png"
                  label="%schema.label"
                  style="push"
                  tooltip="%schema.tooltip">
               <parameter
                     name="newWizardId"
                     value="customplugin.wizard.file.schema">
               </parameter>
               <visibleWhen
                     checkEnabled="false">
                  <with
                        variable="activeWorkbenchWindow.activePerspective">
                     <equals
                           value="customplugin.perspective">
                     </equals>
                  </with>
               </visibleWhen>
            </command>
            <command
                  commandId="org.eclipse.ui.newWizard"
                  icon="icons/deployment-file_16x16.png"
                  label="%deployment.label"
                  style="push"
                  tooltip="%deployment.tooltip">
               <parameter
                     name="newWizardId"
                     value="customplugin.wizard.file.deployment">
               </parameter>
               <visibleWhen
                     checkEnabled="false">
                  <with
                        variable="activeWorkbenchWindow.activePerspective">
                     <equals
                           value="customplugin.perspective">
                     </equals>
                  </with>
               </visibleWhen>
            </command>
         </toolbar>
      </menuContribution>
   </extension>
   <extension
         point="org.eclipse.ui.actionSets">
      <actionSet
            id="customplugin.toolbar"
            label="Hidden Clause Toolbar Commands">
      </actionSet>
   </extension>

</plugin>

bundle.properties

#Properties file for customplugin
Bundle-Name = Customplugin Plug-in
category.name = Custom Wizards
wizard.name = Custom Project
perspective.name = Custom Plug-in Perspective
content-type.name.schema = Hidden Clause Schema Definition
content-type.name.deployment = Hidden Clause Deployment Definition
wizard.name.schema = Schema File
wizard.name.deployment = Deployment File

customproject.label = New Custom Project
customproject.tooltip = New Custom Project
schema.label = New Schema File
schema.tooltip = New Schema File
deployment.label = New Deployment File
deployment.tooltip = New Deployment File
toolbar.actionSet.label = Hidden Clause Toolbar Commands

Help! My [INSERT MOVIE/TV SERIES NAME HERE] DVDs Won’t Play on Kubuntu 9.10!

December 27, 2009 Leave a comment

Just when you thought it was safe to buy DVDs again, after a Ubuntu upgrade of course, things decide to go wrong with the Dragon Player.

I hate when that happens.

Okay, this one is an easy fix. I am running 64-bit Kubuntu 9.10 on a Dell Studio 17 and I performed the (practically) flawless upgrade/reinstall a few weeks ago. I had not run a DVD…until now.

Now I have House Season Five.

Let me tell you that the black screen I was greeted with when I tried playing the first episode of the first disk was rather frightening. Black. Unchanging. Almost like my prospects of a raise at work (no, that is not a euphemism). I watched the hard disk light flash on and off, the DVD player whirr up and down…and nothing.

Very sad to watch. Almost made me want to grow a five o’clock shadow, rip out some muscle from my right leg, get a cane, start downing Vicodin and start calling every one an idiot. I know…it would be an improvement over my normal behavior, but I think you know where I am going with this.

Where am I going with this? Google, of course. It led me to the Ubuntu help pages which led me to the Medibuntu site at:

https://help.ubuntu.com/community/Medibuntu

While the Medibuntu documentation was taut, exciting prose (and I highly recommend you read it if you decide to go down this path) here are the three things I did to make Dragon Player work with the House DVDs that are apparently encoded with horrible horrible (that’s two horribles) encryption (I know, it is hard to say horrible and encryption in the same sentence since I’m such a fan of algorithmic munitions, but sometimes these things need to be said).

Here are the three steps. Remember: Kubuntu 9.10, 64-bit, Intel CPU. YMMV.

sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list &amp;&amp; sudo apt-get --quiet update &amp;&amp; sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring &amp;&amp; sudo apt-get --quiet update
sudo apt-get --yes install app-install-data-medibuntu apport-hooks-medibuntu
sudo apt-get install libdvdcss2

Consider this my post-Christmas present.

Oh, were you waiting for the next part of the Eclipse custom navigator post? Oh, sorry. I can’t even find the cat’s box…

Help! I Can’t Find An Executable Version of XML Copy Editor for 64-bit Kubuntu!

September 18, 2009 5 comments

[I hate when things change; like when Dr. Who died and became someone else. Very disturbing. Anyway, the links to XML Copy Editor listed below don’t work as the maintainer of the getdeb site is no longer updating software for anything prior to Ubuntu 9.04. The getdeb XML Copy Editor drop was part of the Jaunty Jackolope distro which I guess was before 9.04. Any software for prior versions is still available on the getdeb archive site at http://old.getdeb.net/ and the 64-bit version of XML Copy Editor can be found at http://old.getdeb.net/release/4263. Sorry for any confusion this might have caused even though I didn’t cause it and the maintainer of getdeb didn’t mean to. So get over it. Download XML Copy Editor and be done with it.]

[Another update: 3/12/10: Going to http://old.getdeb.net/ does not appear to work. Apparently they are working on the legacy side of their site. Be patient.]

And now for something completely different. By different I mean short.

If you have been looking for a great XML editor I would recommend XML Copy Editor. The original goal of this post was to show you how to download the code and all of the dependencies needed to run XML Copy Editor. The last time I downloaded XML Copy Editor it did not come in a ready-to-run form for Kubuntu. I had to download all sorts of dependencies and cut the heads off of a few chickens to get it to work, but work it did and I was happy.

After installing Kubuntu again I found that I needed to revisit the installation of XML Copy Editor. Wouldn’t you know? I forgot to take notes on how I did it. And it was not trivial the last time I did it.

As it turns out there is a web site that contains ready-to-run, pre-baked versions of all sorts of program including XML Copy Editor. The site is getdeb and I also recommend it as a place to find software you might have thought was unavailable on Ubuntu.

I happen to run Kubuntu 64-bit so a search for XML Copy Editor returned XML Copy Editor for Ubuntu Jaunty 32 bit. Scrolling down the page revealed a version available for Ubuntu Jaunty 64 bit which exactly matched my need.

The cat was alive.

These are a few of my favorite things

XML Copy Editor does a number of things rather well:

  • Checks well-formedness
  • Validates the XML using DTDs, XSDs, RELAX NG and others
  • Applies XSL transforms so you can test what it is you are transforming
  • Executes arbitrary XPath on the current file
  • Supports the creation of 26 XML-related file types

Do I have to mention that it also uses colored syntax, element folding and a built in web browser?

XML Copy Editor: download it from getdeb. Install it. Use it.

Personal Wiki: A Brief Opinionated Review of MoinMoin

July 3, 2009 1 comment

I have just started using MoinMoin as a personal wiki on my Kubuntu/Dell notebook. Why would I do such a preposterous thing?

I have been reading the book Pragmatic Thinking and Learning by Andy Hunt. I will have to review it one day, but suffice it to say that I am on my third reading*.

In Pragmatic Thinking and Learning, Andy Hunt mentions using a wiki to rapidly collect information in a connected, but non-linear, way. The second time I read the book I decided to learn deliberately and when I got to page 221 and read about wikis I started to research what wikis were available, what technology they used and how easy they were to use (wikis by defintion are easy to use, but you never know).**

After much hand-wringing and comparison shopping I decided to download MoinMoin. It is Python-based and does not rely on an external web server or database to work. Installing it was as easy as extracting the archive into my local bin directory and running the Python file wikiserver.py. It starts its own little web server sitting on port 8080 and running Firefox on http://localhost:8080 brought up the home page.

Just to be paranoid I created an account (why would I need to do that on my own local box? Did I mention I was paranoid?) and started creating pages. It was so easy a caveman user could do it.

If you know what a wiki is you don’t need much more information than this to convince you that I enjoyed using MoinMoin. Its use of Python, its ease of installation and ease of use made it almost a no-brainer. I am a Java guy from way back, and as much as I disagree with Python’s use of indentation as a measure of scope, I am quite happy with Python in general. MoinMoin made me even happier.

Give it a shot. Your ideas will thank you.

* Yes, third. The last book I read that many times was Domain-Driven Design by Eric Evans. That is another book that did such a great job of joining ideas that had been floating in my head for years that I recommend it to everyone every chance I get (my mother is still trying to understand what he is talking about, but I am sure she will get it one day. After all, she is 85.).

** Andy Hunt ended the section on wikis by recommending the use of an iPhone with a Ruby-based web server with wiki software to make the collecting of ideas as frictionless as possible. Four out of four dinosaurs disagree.

Help! My Dragon Player is not working in Kubuntu 9.04!

April 26, 2009 Leave a comment

It is unacceptable to have Battlestar Galactica on DVD and be unable to watch it on Kubuntu. However, out of the box, Dragon Player does not know how to play standard DVDs which makes the unacceptable perfectly horrendous.

This fix is an easy one: the Dragon Player doesn’t work without certain drivers that are legally encumbered (that’s code for proprietary with the risk of strongly worded legal letters arriving uninvited at your home) so you have to go get the drivers yourself so as to keep various people, most notably Canonical, from declaring bankruptcy or being embarrassed in court when they kick the RIAA‘s butt (did I say that out loud?).

If you have 64-bit Kubuntu running on a Core 2 Duo and the Dragon Player does not work when you try to play a DVD movie run the following lines from a terminal window (if you want to run them all together put a semi-colon after each command):

sudo wget http://www.medibuntu.org/sources.list.d/intrepid.list --output-document=/etc/apt/sources.list.d/medibuntu.list
sudo apt-get update
sudo apt-get install medibuntu-keyring
sudo apt-get update
sudo apt-get install w64codecs libdvdcss2

I found this information a few months ago at http://www.ubuntugeek.com/install-mplayer-and-multimedia-codecs-libdvdcss2w32codecsw64codecs-in-ubuntu-810-intrepid-ibex.html. It just made it possible for me to watch my legally purchased copy of BSG.

The cat was alive again.

Help! I’ve Installed Kubuntu on my Notebook and the Sound Doesn’t Work!

April 26, 2009 Leave a comment

I just (well, a few weeks ago) installed an instance of Kubuntu on a Dell Studio 17 (the host OS is Vista Home Premium 64-bit) and the volume went from low, after the initial installation, to non-existent after rebooting. Was it possible that the volume on Amarok was down? Nope, it was at 100%. Was the volume setting located in the task bar set to mute? No again. Was the Mixer at fault? No.

After trolling the web and finding many possible reasons for the sudden onset of muteness (bad drivers, conflicting installations of software) I found a simple check that proved to be the most telling: I ran the command line alsamixer and made sure the volume is up!

This is what I saw after I opened a Konsole terminal window and typed alsamixer:
before-small
Notice the lack of color on the third bar; the one labelled PCM. After moving the cursor to the PCM column and pressing the up arrow a few dozen times the bar was nicely multi-colored. This is what the alsamixer levels looked like (notice the PCM is up) after my tinkering:
after-small

I pressed Esc to exit alsamixer and ran the following to save the settings:

sudo alsactl store

The cat was alive.