Page 1 of 2

Making ROX more fun: changing file associations

Posted: Mon 01 Aug 2005, 02:59
by Jesse
Hi,

I've been a bit busy lately but have identified something that can make puppy more fun.

The idea is an application that you barely notice, which makes things work much better.

The problem I saw: in a rox window, clicking on a x.txt file opens it in leafpad, clicking on playlist.asx (a gxine playlist) opens the playlist in leafpad, thats useful... and I could not find a way to tell ROX to think of them differently.

The really clever solution IMHO, is to replace the file /root/Choices/MIME-types/text_plain
with the attached file.

It lets you choose which app you want to open the file with, by a simple menu list, which looks like part of the ROX application.

This is just a hack at the application to get peoples opinion if this is something that puppy needs. If this is met with good feedback, I can quite easilly add in a 'database' for all the app types, and an option to add in new file types that the user comes across.

Is this a good idea or not? did I just not find the right way to configure things?

Jesse

Posted: Mon 01 Aug 2005, 03:06
by Bancobusto
I think that's a great idea.

for example, I would like to be able to associate .CUE files with mplayer, but Rox see's them as text files (fair enough, i guess).... changing the association to mplayer would mean that all text files would try to get played their...


good stuff :lol:

Posted: Mon 01 Aug 2005, 03:23
by Flash
/root/Choices/MIME-types/text_plain is a symlink to /usr/local/bin/abiword in my computer. What should I do?

I'm running 1.0.4 from CD, with a pup001 file on the hd.

Posted: Mon 01 Aug 2005, 03:28
by Lobster
Yes very good idea - never had the expertise to do this but it is required for us Rox rockers :)

In a similar way we might include

create new image (opens mtpaint)

Posted: Mon 01 Aug 2005, 04:23
by GuestToo
you can easily change the file associations by editing
/usr/local/share/Choices/MIME-info/Standard

(or copy it to /root/Choices/MIME-info/Standard and edit the copy)

you can setup an association for any file extension(s) you like ... (it's how the dotpups work)

Posted: Mon 01 Aug 2005, 06:32
by Bancobusto
Cool, 8)

Thanks GuestToo

Posted: Mon 01 Aug 2005, 08:29
by Jesse
Hi GuestToo,

yep, you can certainly edit those files by hand if you like, but you have to rely on the "file" application returning the correct MIME-type for the file.
Also you have to be up with the play on what mime types are and where those files are stored, and how to write shell scripts... But it doesn't exactly give you option to open a file in a particular application on-the-spot :)

But "file" is not always perfect, for example it identifies a gxine playlist *.asx (XML) as text_plain and that isn't quite desireable
The app that I posted above would idealy be called for all of the mime types, and match against the MIME-type as well as the file extension, and have an option like "configure type..." so that you can set another application or an application for an unregistered type through a window like M$ "open with..." dialouge. i.e. a GUI option instead of a command line one.

Comments? thoughts?

Jesse

Posted: Mon 01 Aug 2005, 08:53
by BarryK
Jesse,
I haven't tried your program yet, so hope my comment is relevant.

yes, i want to keep the current open menu, but sometimes i want something different, like want to open a .gif with xpaint instead of mtpaint for example.
So, something like Microsoft's "Open as..." would be great.

Do you know we already have something like that in the Uxplor file manager?
Right-click on a file and you get quite a nice menu of choices -- it doesn't have any file associations, just a fixed menu.
The menu used in Uxplor is actually a separate little Xlib program.

Posted: Mon 01 Aug 2005, 09:12
by Bancobusto
I find that the "send to" menu works quite well usually with the existing Rox...

For example I have the option to send folders to XmmS by right-clicking, send-to, xmms.

Seems to work for whatever programs you symlink the send--to folder to.

Don't know if that helps :?

Posted: Mon 01 Aug 2005, 10:39
by Jesse
Ok, so heres a screen shot of how it would work...
The menu pops up to select the application when you click to open the file, in this case when clicking on the file text_file_demo.txt

Posted: Mon 01 Aug 2005, 23:33
by GuestToo
one thing i noticed about vi
if you close rxvt by clicking the Close window button
vi continues to run as a background process, with 99% cpu usage
you need to close vi using :q

Posted: Tue 09 Aug 2005, 13:07
by Jesse
Hi,

So yeah heres a screenshot of the "select application dialouge box"...
the window that appears when you click on "Select..."
all working except for the "Accept ALL" button, which should be done in a day or so.

http://tinypic.com/a9s40y.png

So does this look intuitive? could it be better somehow?
go on tell me now, you'll be using it in the next puppy* :o)

Jesse

* maybe

work hard - stay frisky

Posted: Tue 09 Aug 2005, 13:43
by Lobster
Looks fine (and useful) to me

Was it done in Tcl?

Is Mut 0.0.6 on the horizon - boy is that a useful program . . .

Just for you Jesse . . .

a potential Pup launcher (written in XUL)
http://www.georgenava.com/applauncher.php

somewhere to store your files, bookmarks, emails etc (online)
https://axentra.net/homebase/registration

. . . and something for the Peter Pan in you :)
http://thepiratebay.org

User's paradise

Posted: Tue 09 Aug 2005, 14:08
by raffy
a definite addition to userland, where there is a sign on every path. thanks!

BTW, in other threads, there was this mention of certain scripts executing only when ending in .com. how is this handled here?

Posted: Wed 10 Aug 2005, 01:00
by Jesse
Hi,

Yep, it is written in Tk/Tcl, and fairly small, about 10K including its currently minimal database of file associations (1K).

Yes I think I need to figure out a good way of handling executable files, as they don't usually have an extension... a .com file is easy to handle as it is.

I think I'll do a "how to" for Tk/Tcl widgets as they are very confusing but simple, but quite powerful for a scripting language once you get your head around them.

MUT is very useful as is, and yes there is room for improvement... I'm thinking that getting these file associations working would be better than a few MUT cosmetic changes, for the moment, and there are a few other tk/tcl projects that look very tempting...
There are two quirks in MUT that I'm likely to change quite soon, so yes there will be a 0.0.6 MUT but probably not as much of an advance as what you might be hopeing for.

Jesse

Posted: Wed 10 Aug 2005, 07:30
by Lobster
:)

I hope it is added to your wiki Tcl tutorials . . .

http://www.goosee.com/puppy/wikka/LearnTclTk

Posted: Wed 10 Aug 2005, 12:30
by peppyy
An "open with" dot pup would be great! I have just spent half a day trying to figure out why I couldn't open any text or abi files and it looks lihe it is all from associating .asf with mplayer. Never knew that it would change all the files with a text icon.

What are the chances of seperating extensions so they could be associated individually? Open .abw with abiword and ,txt with beaver etc.

Posted: Wed 10 Aug 2005, 17:27
by Bancobusto
I know it may be to size issue, but the newer version Rox that came out has all these features and more. I hope that we can upgrade to it eventuallly :lol:

Posted: Thu 11 Aug 2005, 03:43
by Guest
peppyy wrote:What are the chances of separating extensions so they could be associated individually? Open .abw with abiword and .txt with beaver etc.
it's easy ... just add something like this to /root/Choices/MIME-info/Standard (or /usr/local/share/Choices/MIME-info/Standard)

Code: Select all

text/abiword
	ext: abw ABW
here's a dotpup that will setup a rox file association so that abw files will open with Abiword when clicked

Posted: Thu 11 Aug 2005, 03:46
by GuestToo
the Abiword file association dotpup post was mine