Almost programming... Mime in VT Q.

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

Almost programming... Mime in VT Q.

#1 Post by sunburnt »

ROX does mime associations, but the VT doesn`t. Why not?
This seems odd, but there may be a reason for it.

I`d like to have the default app. run if a mime file is entered in a VT.
Song.mp3 gets mPlayer
Image.png gets mtPaint

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#2 Post by Karl Godt »

You would need something like SOUND_PATH i guess to search directories for song.mp3

Code: Select all

set show-all-if-ambiguous on
into /etc/inputrc

would at least work for TAB completion to show files and dirs .

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#3 Post by sunburnt »

I`m not sure this is what I`m talking about Karl.
The path is being supplied, but the mime is not working for VTs.

If you click the file: Song.mp3 in ROX-Filer it starts the default music player.
But if you do this in a VT it doesn`t work, you get an error:

Code: Select all

sh-4.1# /mnt/sdb3/Music/Cheers-ThemeTV.mp3
sh: /mnt/sdb3/Music/Cheers_ThemeTV.mp3: cannot execute binary file
If it works in the file browser, why not in the console?
Obviously ROX is the reason that it works in the file browser.

The console makes no assumptions about the graphical desktop environment.
So I suppose there would have to be CLI apps. installed for it to be complete.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#4 Post by L18L »

Hope I am talking about what you mean.

Once upon a time a terminal that was a teletypewriter without graphics and without mouse (not yet invented), everything text only.

A virtual terminal does just emulate this.
Thus you have to type some text, for example:

Code: Select all

mplayer /usr/share/audio/goodluck.m4a
or (less typing if you use it more than once)

Code: Select all

alias m=mplayer
cd /usr/share/audio

Code: Select all

m good*
:D

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#5 Post by Karl Godt »

The whole thing would need to alter the bash source code to implement a loading of a mime database file when typing "bash" .

Every input after "Enter" then has to be checked as it is today if exist, is in PATH, is alias, is executable or readable or writable, if file or dir etcetc and additionally if (some of) these tests fail if in mime.db file .

So you would need something like /etc/bash/mime.types thats get parsed every time .

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#6 Post by sunburnt »

Exactly Karl..! I could only think how complicated and messy Linux mime is.

I entered .sq* in the mime file globs and it loads a SqApp file when clicked.
But doesn`t it seem this type of functionality should be in the console also?

Constantly accessed files like /etc/resolv and mime should be in the initramfs.

To fix Ash and Bash, an exec. wrapper seems to be the best solution.
A separate console globs file allows different apps. than the desktop.
If there is not an entry for the file type, the regular globs file is parsed.

With the hack of a junction I made, files wouldn`t need a path or to be in PATH.

I`ll let you know what I come up with... Terry B.

Post Reply