![]() |
Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
Quote:
Quote:
I literally just uploaded the .deb produced by PyPackager. If your .deb installs OK (and you have dependencies), you can follow my instructions and it will upload. |
Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
OK, someone asked in another thread about listening to MP3 files from the browser (GrandCentral's Inbox) via a program other than the Media Player. I tried hacking around, and I discovered that I had to change defaults.list, uri-action-defaults, AND mimeinfo.cache. What a pain!
I used leafpad as root, and I just did a search and replace in mimeinfo.cache. search: = replace: =hildon-dbus-switchboard.desktop; pipeline, I'm really thinking that, for this program to really be "easy", you're going to have to replace the three mime-related files in /usr/share/applications with your own version, and run everything through the switchboard. It means a lot of the default stuff has to be brought into your config files, but it also means that users can make all of their changes from the switchboard GUI. At the moment, you still have to hack around as root on the text files before you can start using the GUI. But a new user will try to use the GUI, think they've added a new mime type, and get frustrated when it doesn't do anything. |
Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
I agree... no doubt new people would be frustrated at inability to reroute 'already known/handled' types, and this would be good to add. The main reason i havent made it 'that easy' is simply that i dont know the linux command (regex/sed?) to search/replace a pattern within a file so that i can comment out existing mime types as needed. Perhaps someone could provide example?
Next, I went through the use-case of using xmms and noticed i dont have the right 'sample mime type' of audio/x-mp3. I also didn't have an xref to use xmms, so I'll add both of those to next version. After doing that it was as easy as editing the defaults.list for that one type and then rebooting (to regenerate the mime cache) and i had filemanager support and internet browser support (this is not a streaming file so no need to edit uri-actions-defaults... it just downloads to /var/tmp and plays from there. This simple process could be made automated if i knew how to search/replace the defaults.list and if i added mime-registration to dbus-switchboard gui. I will also probably need to determine command to regenerate mime-cache (i think its 'update-mime-cache /usr/share/mime' as root) to avoid needing reboot. But there are a few questions remaining : - Why does the Media Player (in the thread you referenced) not like the file when its streamed but it does work when saved? That in and of itself should be fixed with a maemo bug report. - What alternative mp3 player would you use? Perhaps if theres an app not in my apps list it would help to add that. As far as I know theres just XMMS that is a viable alternative (aside from other apps working around media player bugs). - How far do you go to undo the behavior which maemo is pushing? Should i completely hijaak the mime system because its not 'easy'... this should really be resolved with maemo solution and/or careful coexistence otherwise this whole framework is one SSU away from being obsolete. I think a registration list in the gui to 'opt-in' for each mime-type is best way to not hijaak... especially since maemo apps have not published their dbus interfaces and to hijaak media player and not work as well with media player is a net loss for someone who never wanted to change that in the first place. Now... how about getting free to put xmms into extras! After all... my only viable handler requires gronmayer! This cannot be tolerated! ;) |
Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
Quote:
Quote:
You could also have a GUI button to restore the default mime files. Quote:
Quote:
|
Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
Quote:
|
Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
Quote:
|
Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
OK, so I just managed to catch up with every thing you two have posted (I was sick for a bit, and the meds were messing with me while I was taking them for a couple days after).
First off: I think that pypackager will actually upload to the extras or extras-devel repo for you (I haven't tried obviously) but the settings are there on the second to last tab. If you can get that figured out, that will be great (for this and for the various mono related works). Second: I have an idea for the defaults.list. mlbviewer, which I based my gui app off of and whose config file I use verbatim, uses a trick where they read and write the file in dictionary context. Code:
dct = {} And third: I use a different method for launching media from mlbviewer. I don't us dbus-send, I use the python osso.Rpc class, and it works for streaming audio and streaming video: Code:
rpc = osso.Rpc(self.osso_c) From my understanding, if you want a local file you have to include 'file://' prior to '/home/whatever' so that you have 'file:///home/whatever' But that does invoke the media player ui, so I don't know that it really helps with xmms. It does, however, tell me that some where there is a definition telling maemo to use that same command when you open a file. Looking at the service file for mediaplayer, I can't find anything that defines 'mime_open' so I am guessing that it is an assumed method for opening files. This seems to correspond to what khertan has worked out with his mime handling in pygtkeditor. So the pass through to existing apps should just be their service, with the 'mime_open' method. I think... I could be very very wrong. |
Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
Quote:
Quote:
The best way to give your app root access is to drop a little file into /etc/sudoers.d, something like: /etc/sudoers.d/switchboard.sudoers The most generic thing to do is just make "sudo" work for everything: Code:
user ALL = NOPASSWD: ALL Code:
user ALL = NOPASSWD: /usr/share/applications/defaults.list Quote:
I look forward to your next version! I want to do a write up about this on my blog (for Planet Maemo) but I feel that it still needs that little bit extra tweaking before it's ready for the average user's tablet... |
Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
Thanks for the info on sudoers Qole! I've been too busy (lazy) to look up that info for myself, but I think it will be very helpful (again for both this and for working with Mono).
If pipeline hasn't started on it already, I'll start working on that tonight to see if I can get it up and running with the gui. Maybe I'll actually make some of the changes I've been wanting to make while I'm at it. |
Re: How To : Associate MPlayer, Transmission, and other apps as default handlers
I'm having second thoughts about the "conservative" sudoers settings. You may have to experiment with that, to find out exactly what you need to include. I suspect you'll need to at least include the app you use to edit your system files, too.
|
All times are GMT. The time now is 12:09. |
vBulletin® Version 3.8.8