Welcome to SparkyLinux forums
Zapraszamy również na polsko-języczne Forum

Openbox file associations

Started by niftyprose, June 05, 2018, 07:07:02 PM

Previous topic - Next topic


Hi guys, I have a feeling that this has been asked before, but I couldn't figure out how to phrase a generic question. Apologies if I cause frustration.

I'm on Sparky/Openbox. I use Geany for text editing (esp. coding) and TKOutline for brainstorming and scheduling.

Geany stores .txt files. TKO stores text files with its own markup language in .tko format.

If I right-click on a .tko or .txt file and choose an application to open it, I get the familiar 'Use as default for this kind of file' option. But this results either in .txt files being opened in TKO or .tko files being opened in Geany, (depending on which application I last selected).

Is there a way to handle file associations based on suffix, so that .txt files are always opened by Geany and .tko files by TKOutlline?

Best, NP.


Right click on a file-> Properties-> Open with-> choose an application.
Nothing is easy as it looks. Danielle Steel
Join at [url="//"][/url]


Thankx, Pavroo, but you misunderstand me I think.

Can I set things up so that:
{Doubleclicking on a .txt file launches Geany} && {Doubleclicking on a .tko file launches TKOutline}
...despite the fact that .tko files are just .txt files with some unusual markup in the text?

I guess I could parse that as: can I make file associations based on file suffix rather than filetype?



It was what I was trying to say...
Right click at a .txt file and set (via the Properties) Geany to the default app to be opened all .txt files, then right click at a .tko file and set the TKOutline as default.
Is it what you need now?
Nothing is easy as it looks. Danielle Steel
Join at [url="//"][/url]


Ah, OK, you *did* understand me, Pavroo.

I'd have expected the solution you (patiently) explained to work. But what happens is that, if I make the file association between .tko  and TKOutline, .txt files will then also open TKO. Conversely, if I associate Geany with .txt files, Geany is launched when I double-click a .tko file.

Presumably this is unusual behaviour in Sparky? I wonder if it's to do with TKOutline's relationship with TCL?

Best, W.


i suggest to check the file:
and set/remove/join your file types with your favorite apps.
then re-login to take effects.
Nothing is easy as it looks. Danielle Steel
Join at [url="//"][/url]


Hi Pavroo, thank you for setting me on the right course. I've been messing with /.config/mimeapps.list and /etc/mime.types. No luck yet, but the root of my problem is clearly that I need to identify .tko files to the system as a distinct form of text file needing special handling. I've enquired elsewhere about the necessary mimetype setup forTKOutline/ TCL and will report back. Best, NP


Hi, Pavroo and everyone,

I finally sorted this out. Although it's pretty obscure, I guess someone out there in the wider Debian community might want to define their own mime type, too. I had thought the problems described in my first post on this topic were specific to text files originating in TCL. Now I think that my problem was an instance of a more general issue about mime registration.

After Pavroo's useful intervention, I mailed the developer of TKOutline for advice. He had never needed to associate a new filetype to work with his software, but he gave me a pointer:


1. Associate mime type to file extension
2. Associate the mime type with an application .desktop file to execute
3. Write the application .desktop file and place it in a proper location
For #1, I think this line needs added to /etc/mime.types or $HOME/mime.types

application/x-tkoutline  tko

For #2 something like this in the ~/.config/mimeapps.list:


For #3, something like this should work (replace with your actual path
to tkoutline-devel-linux
( for
some related details):

[Desktop Entry]
Comment=Edit hierarchical outlines
Exec=/home/btheado/Downloads/tkoutline-devel-linux %U

From what I read, that .desktop file should either be in
$HOME/.local/share/applications or /usr/share/applications.


This *is* what you're supposed to do, but when I tried it it didn't work. I then checked in the Ubuntu documentation and found a note from someone else for whom it hadn't worked ( and scroll to 'Another way'.) Their recipe, which involves manually editing an XML file contained in /usr/share/mime/application didn't work for me either, but at least it got me looking in the right part of the file system.

What finally did work was this:

As per the instruction:

i. I installed xdg-utils
ii. created the following XML file:
<?xml version="1.0"?>
<mime-info xmlns=''>
   <mime-type type="application/x-tkoutline">
   <glob pattern="*.tko"/>
iii. gave it the name x-tko.xml
iv. issued the command xdg-mime install x-tko.xml

I can now launch TKOutline by double-clicking a .tko file. Phew!

Best, NP

View the most recent posts on the forum