This post describes how to configure the Gnome desktop to properly handle and display the Tweakstreet file types .cfl and .dfl and also correctly relate the relevant icons.
Because Gnome does not know the .dfl and .cfl file types of Tweakstreet, the files will not be properly displayed in the file manager. They are assumed to be text files and double-clicking will launch them typically in a text editor.
We have to do three things:
- Add a .desktop file to your system
- Add two new Mime types for the .cfl and .dfl file types
- Add two icons that belong to the file types
Please note this might not work for you dependent on the operating system you are using. Note also that you might need sudo or root privileges to create the file or execute the commands.
First add the tweakstreet.desktop file to the system. After adding it, the Tweakstreet application will be available when opening the activities view in the Gnome desktop and e.g. searching for an application. Add the below code to a file named tweakstreet.desktop in folder /usr/share/applications.
[Desktop Entry]
Name=Tweakstreet
GenericName=Tweakstreet ETL Development Tool
X-GNOME-FullName=Tweakstreet
Comment=ETL (Extract-Transform-Load) Development Tool
Keywords=Data;ETL;ELT;DWH;Database;Extract;Transform;Load;Process;SQL;NoSQL;JDBC;Dataflow;Pipeline;Flow
Path=/opt/tweakstreet
Exec=/opt/tweakstreet/tweakstreet %f
Icon=/opt/tweakstreet/bin/images/icon.png
Categories=Development;Data
StartupNotify=true
Terminal=false
Type=Application
Encoding=UTF-8
MimeType=application/vnd.tweakstreet.data-flow+json;application/vnd.tweakstreet.control-flow+json
You will need to adjust the Path, Exec and Icon settings according to where you installed the Tweakstreet application. Below is the icon referenced above. Put it somewhere on your filesystem and reference it in the setting named:Icon.
To add the Mime types, add a file tweakstreet.xml (or a similar name) to the folder /usr/share /mime/packages. The content of the file lookes like this:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/vnd.tweakstreet.data-flow+json">
<comment>Tweakstreet Data Flow</comment>
<glob pattern="*.dfl"/>
</mime-type>
<mime-type type="application/vnd.tweakstreet.control-flow+json">
<comment>Tweakstreet Control Flow</comment>
<glob pattern="*.cfl"/>
</mime-type>
</mime-info>
Save the file and then run following command to update the mime database:
sudo update-mime-database /usr/share/mime
Next, the icons (actually .png files) have to be copied so that they are found by the Gnome desktop. Copy the two images below to the folder /usr/share/icons/gnome/256x256/mimetypes. Name the first one application-vnd.tweakstreet.control-flow+json.png and the other one application-vnd.tweakstreet.data-flow+json.png.
Now run following command to update the icon cache:
sudo gtk-update-icon-cache /usr/share/icons/gnome -f
Now open the tweakstreet application and create a control flow and a data flow and store them in a folder. Close the tweakstreet application. Open the filemanager and naviagte to the folder where you stored the two files. Both files should display the relevant image/icon. If you right-click the files and check for the properties, the correct Mime type should be displayed. If you double-click the files, they should correctly open in the tweakstreet application.
Note: On the first time, you might first need to connect the files to the correct application by right-clicking, selecting the properties and then “open with…”. Connect the file to the Tweakstreet application which you should find in the list of available applications.
Here is a screenprint of the files in the filemanager:
If you press the Windows key to show the activities view and start typing: t-w-e-… then the tweakstreet application should be correctly displayed and can be launched.
If all worked well, you should now have the Tweakstreet files associated with the Tweakstreet application and they have the correct icons. When you open the Gnome activity view, you can search for and launch the application.