SoftMaker File Associations and Icons on Ubuntu
2007-12-26 10:42:44
SoftMaker Office has a native version for Linux, but unfortunately it lacks an installer and by default does not create any file associations for its TMD and PMD formats. This guide explains how to do this (it may also be a useful source of reference for creating other file associations on Ubuntu).
This guide explains how to configure:
- Mime-types (so Ubuntu knows what sort of file TMD/PMD are)
- Gnome menu entries for Textmaker and Planmaker

- Default "open-with" action for TMD/PMD filetypes
- Icons for TMD/PMD format

It is recommended that you have some experience in using the terminal and editing configuration files before proceeding. It is also advisable that you peform a backup before proceeding. This method worked when tested on Ubuntu 7.10, but it may not be the best method.
This guide assumes that Softmaker Office 2006 is installed in /opt/office
Step 1: Creating a mime-type
The first step is to create a "mime-type" which will be used to allow Ubuntu to
recognize the TMD/PMD formats, based upon the file extension. To begin, open a
command terminal and execute the following command:
sudo gedit /etc/mime.typesNow, append the following lines to the file and save it:
application/tmd.textmaker tmd
application/pmd.planmaker pmdStep 2: Defining the mime-type
Next we need to give Ubuntu a way to decide if files are of the Softmaker file-types.
To do this we create /usr/share/mime/packages/sm.xml:
sudo gedit /usr/share/mime/packages/sm.xmlEnter the following into the file:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/tmd.textmaker">
<comment>TextMaker Document</comment>
<glob pattern="*.tmd"/>
</mime-type>
<mime-type type="application/pmd.planmaker">
<comment>PlanMaker Document</comment>
<glob pattern="*.pmd"/>
</mime-type>
Save and close the file. Now, to make the above take effect run the following in the terminal:
sudo update-mime-database /usr/share/mimeStep 3: Assigning file icons
This step is fairly simple - just copy the Textmaker and Planmaker icons into
the "mimetypes" folder of the theme you are using (or just copy them
into the Gnome theme, which most other themes inherit). The new file will need to
be called "gnome-mime-application-<mimetype goes here>.png"
sudo cp /opt/office/icons/tml_48.png /usr/share/icons/gnome/48x48/mimetypes/gnome-mime-application-tmd.textmaker.png
sudo cp /opt/office/icons/tml_32.png /usr/share/icons/gnome/32x32/mimetypes/gnome-mime-application-tmd.textmaker.png
sudo cp /opt/office/icons/tml_32.png /usr/share/icons/gnome/24x24/mimetypes/gnome-mime-application-tmd.textmaker.png
sudo cp /opt/office/icons/pml_48.png /usr/share/icons/gnome/48x48/mimetypes/gnome-mime-application-pmd.planmaker.png
sudo cp /opt/office/icons/pml_32.png /usr/share/icons/gnome/32x32/mimetypes/gnome-mime-application-pmd.planmaker.png
sudo cp /opt/office/icons/pml_32.png /usr/share/icons/gnome/24x24/mimetypes/gnome-mime-application-pmd.planmaker.pngTo make the above icons display simply run the following in terminal:
cd /usr/share/icons
sudo gtk-update-icon-cache --force gnomeStep 4: Creating a .desktop (menu entry)
We now need to create a .desktop file. This creates an entry in the Gnome menu and
also is used when we create the default "open with" command in Step 5.
sudo gedit /usr/share/applications/tm.desktopNow, enter the following into gedit and save the file.
[Desktop Entry]
Encoding=UTF-8
Name=TextMaker
Type=Application
MimeType=application/tmd.textmaker
Comment=SoftMaker Word Processor
Exec=/opt/office/textmaker
Icon=/opt/office/icons/tml_48.png
Categories=GNOME;GTK;Office;
Terminal=false
And the same for Planmaker:
sudo gedit /usr/share/applications/pm.desktopAnd Planmakers desktop entry:
[Desktop Entry]
Encoding=UTF-8
Name=PlanMaker
Type=Application
MimeType=application/pmd.planmaker
Comment=SoftMaker Spreadsheet
Exec=/opt/office/planmaker
Icon=/opt/office/icons/pml_48.png
Categories=GNOME;GTK;Office;
Terminal=false
The Gnome menu should now show Textmaker and Planmaker under the Office submenu.
Step 5: Setting the default "Open-with" actions
The step simply tells Ubuntu to use the above entrys to launch TMD/PMD documents.
To start, run the following:
sudo gedit /usr/share/applications/defaults.listAnd add the following to the end of the file:
application/tmd.textmaker=tm.desktop
application/pmd.planmaker=pm.desktop
Now, restart your computer to make the changes take effect. You may be able to make the settings take effect by running the following:
sudo update-desktop-database -q /usr/share/applicationsFinished
If everything went well you should now have .tmd documents associated with Textmaker
and showing the Textmaker icon, and the same for .pmd documents with Planmaker.
