Active Topics

 



Notices


Reply
Thread Tools
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#1
(Minor Update 4/11/09) : New version 1.2.8

- Mime Type integration... mostly you will notice icons for certain filetypes... doc files and excel files have nice icons, and there are simple icons for .cpp, .py, .sh, .csv, .rtf, .cs, .h files.
- Removed Debian Hack since its not needed any more
- Added geany, pygtkeditor, leafpad

Thaks goes to hvacengi for the gui editor, which allows you to configure everything... without having to use xterm.

Dbus-Switchboard Version 1.2.8

You may need a reboot after first install.

Overview :
Normally, the File Manager and web browser can only launch hildonized programs, passing parameters over dbus messaging. DBus-Switchboard intercepts those messages for certain mime types (file types) and passes them over the command-line to programs which were not coded for dbus (like mplayer and transmission).

So basically, you install the dbus-switchboard program. Immediately certain filetypes should be 'activated'... for instance bittorrents and the last chance 'catch-all' mime type : application/octet-stream. Pretty much if your maemo os doesnt know what mime type a file is, then it just calls it application/octet-stream... which will pick up xls, csv, flv, gpx... pretty much all the types which dont already have a nokia app to handle it.

If you want to take over a type currently handled by a maemo application you would load the dbus-switchboard gui program and go to the defaults tab to enable intercept of that mime type. You can find the mime type of a file by tapping-and-holding the file in file manager and choose 'Details' and the 'type' is the entry you will need to intercept in the 'defaults' tab of dbus switchboard gui.

Once intercepted, you will need to have an application in the xref tab which maps the actual file extension of such files to a 'handler' which is specially formed command line for launching programs which accept command line parameters.

So the mapping goes OS->(defaults)->DBus-Switchboard->(xref)->(handlers)-> finally to the app you want to use.

All configuration is done in the (defaults), (xref), and (handlers) tabs.

Parameter Options :
Dbus-Switchboard gets a filename from Dbus when a file is launched from file manager or microb browser... this filename is not always in a format which command line programs understand. I provide several parameter (filename) formats which convert special chars to hex encodings, or vise versa and also provide gnome vfs file format (file://) or traditional volume mounting (/home/user/test.doc)

Example of param evaluations :

%params% : file:///media/mmc1/My%20Sample.doc
%params2% : /media/mmc1/My%20Sample.doc
%realparams% : converts any hex to actual symbols... you will probably need quotes
%realparams2% : same as above but forces filename starts with file://



Main functionality supported :

- AVI support for mplayer (enable video/x-msvideo) in defaults tab
- torrent support for Transmission (automatically enabled application/x-bittorrent)
- XLS and CSV files are now associated with Gnumeric
- XLS support using OpenOffice Calc (debian chroot)
- GPX file support using maemo-mapper
- DOC viewer using Antiword to convert PDF for display (download antiword here).
- DOC, ODT support using OpenOffice Writer (debian chroot)
- PPT (powerpoint) support using OpenOffice Impress (debian chroot)
- Evince for PDFs (enable application/pdf in defaults tab)
- MID (midi file) support for timidity
- Ebook formats PDB, MOBI, CHM, RTF support using fbreader (CHM support in fbreader is limited)

Other programs can be added within the program. To determine the mime type associated with your file, tap-and-hold stylus on you file in File Manager and view details to see the 'type'... if not already associated (and not blank), then that type should be enabled in dbus-switchboard's defaults tab and an appropriate handler and xref should be set up to handle files of similar extension (.rm, .cbz, .mp4)

For FBReader, check out http://memoware.com and look primarily for Plucker, Mobipocket, or RTF. PDB files come in various formats but i have only had luck with the pdb files in Plucker format.

Once installed you can enable and disable which defaults (mime types) dbus-switchboard will intercept. For example, double clicking on 'x-mp3' in the defaults tab will route all mp3's to XMMS by default, or it could go to whatever other program you configure it for.

Currently the main tabs you should use are Xrefs, Handlers, and Defaults (screenshots at end of post). The Urls and Uri tabs are not functional but the should usually not be used anyways.

Parameter handling is inconsistent among the maemo apps available. Some only accept dbus parameters, some only accept command line parameters, some accept both dbus and command line parameters, and some accept neither.

If you attempt to associate an application i haven't configured it for, it may or may not work or require specially forming the command line setting in dbus-switchboard config files before it will accept it. Experiment launching files yourself from xterm to get the command line right.

If you figure out new apps that work, let me know and i'll add them to configuration files.

To debug (if association doesnt work), load in xterm dbus-switchboard.py so that future request are logged (visible) in xterm console. This isnt necessary though since hildon will launch it invisibly if you dont manually have it loaded.
Attached Images
   

Last edited by pipeline; 2009-04-11 at 04:29.
 

The Following 75 Users Say Thank You to pipeline For This Useful Post:
Posts: 1,950 | Thanked: 1,174 times | Joined on Jan 2008 @ Seattle, USA
#2
Thanks for what appears to be a very useful task you've done. I'm not sure I understand it, though. If I install your utility will mplayer, for example, necessarily be selected as my player of, say, mp3 files? What if i wanted them to be played in Canola or in another app? Can I use it to associate other files with programs or are all the associations pre-determined within the utility? I can't remember what, but I know I've wanted to change some associations for file types -- will this utility enable that? Thanks!
__________________
.
. .

Help Save This Forum
for N8x0/Diablo Users! Register and Vote for Solution #1 on this Brainstorm. (The Solution will let you see New Posts with any threads you choose -- like the N900 and Maemo5/Fremantle threads -- filtered out.) (To understand the Solution better, see these posts #17, #18, and #19.)
 

The Following User Says Thank You to GeraldKo For This Useful Post:
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#3
(This message is obsolete... it talks about the first, very limited version that i released)
---
right after you install it, nothing immediately is any different.. you need to manually assign the mime types in the /usr/share/applications/defaults.list to hildon-dbus-switchboard.desktop

It is python though, so hardcoded means you could edit the python (text) file in /usr/bin/dbus-switchboard.py to pick any other media player that accepts command line parameters.

Does canola accept command-line parameters? I thought it just used mplayer or media player engine to run video.

Eventually it would be nice to have a separate python program to edit these associations and save config to file... and then make dbus-switchboard read from that configuration file... then you could switch out the associated app on the fly without editing (as root) the python file. I'm not too advanced making python programs so any help would be appreciated.

Last edited by pipeline; 2008-12-29 at 00:43.
 

The Following 2 Users Say Thank You to pipeline For This Useful Post:
tsvest's Avatar
Posts: 35 | Thanked: 1 time | Joined on Feb 2008
#4
I tried to install the program but it requires additional packages related to Python. Where is the best place to get these? (A direct link would be great)
10x
 

The Following User Says Thank You to tsvest For This Useful Post:
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#5
Originally Posted by tsvest View Post
I tried to install the program but it requires additional packages related to Python. Where is the best place to get these? (A direct link would be great)
10x
It's in maemo extras i think... make sure to have that repo enabled. With that enabled i should think it would automatically pull in python but you can manually install python runtime using this....

In xterm :
sudo gainroot
apt-get update
apt-get install python2.5-runtime
 

The Following 2 Users Say Thank You to pipeline For This Useful Post:
gigabites's Avatar
Posts: 122 | Thanked: 21 times | Joined on Sep 2006
#6
I got .pls, .m3u, and .mp4 t open with KMPlayer. I'm still trying to get .avi and .flv to open with KMPlayer.

newbie tips:
- using emelfm2 to edit the text files makes it all easier (I did it as root)
- I never delete lines, just comment out the line with a # symbol at the beginning of the line (#video/mpeg etc...)
- reboot for it all to take effect. I thought I messed up because nothing worked until I rebooted.
- there may be a slight lag so as pipline said, click your file only once

Hope that helps some people. Thanks goes to pipeline for making my N800 better.
 
tsvest's Avatar
Posts: 35 | Thanked: 1 time | Joined on Feb 2008
#7
Originally Posted by gigabites View Post
- using emelfm2 to edit the text files makes it all easier (I did it as root)
Can you please explain exactly how to do that?
Do you become root in xterm and then star emelf2 or you start emelf2 and then gain root?
__________________
N800, OS2008
Greetings from Bulgaria
 
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#8
You become root in xterm, then start emelfm2.

Thats only needed to edit files outside your /home/user directory (usually).

If its a file (outside /home/user) that you want to repeatedly edit, then (while your running emelfm2 in root mode), set permissions to allow user to edit the file. Then the next time you can edit it without root permissions. If its an important system file you might not want to give this write permission to user for security reasons... in that case just xterm/sudo gainroot/ and edit each time.
 
tsvest's Avatar
Posts: 35 | Thanked: 1 time | Joined on Feb 2008
#9
I have enough experience with MS DOS and Windows, but Linux and especially Maemo gives me hard time...
I am able to become root, but when I type emelf2 at the prompt I get
'/bin/sh: emelf2: not found'
Obviously the emelf2 is not in the PATH or whatever is the Maemo equivalent. It is strange for me that when I type mplayer at the prompt mplayer starts...
The obvious solution in such case is to find the exact location of emelf2 and start it with its full path, but I can't get it - I found a reference list with the most useful Linux commands and tried without success 'locate' and 'whereis'...
I found a command that shall do this job in Maemo in another post at ITT:
'find / -name emelf2', but I only get two paths and after them ':Too many open files'
I also tried to use the Find pluging in emelf2 but it crashes every time (Does anybody has the same problem?)
I tried the Search program under Applications\Utilities from N800 desktop, just to get disappointed again...

I am used to get full control on my devices/computers, but this is not the case with my N800 - I spend too much time struggling with simple tasks

I completely agree with you, pipeline, that changing the file associations is not 'as easy as it should have been in the first place'

I also share the dream of one of the forum members, who wrote that it would be nice to have a switch/option in Control Panel which turns off all restrictions, so the user can realy have full access to the device he bought...

Do I need to install something more to be able to run these commands in xterm?
__________________
N800, OS2008
Greetings from Bulgaria

Last edited by tsvest; 2008-05-10 at 20:15.
 
pipeline's Avatar
Posts: 693 | Thanked: 502 times | Joined on Jul 2007
#10
you're leaving out the second letter 'm' its emelfm2 as in emel filemanager (fm) 2 panes
 

The Following User Says Thank You to pipeline For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 22:47.