[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gcmd-dev] Mime editor
From: |
Michael |
Subject: |
Re: [gcmd-dev] Mime editor |
Date: |
Tue, 27 Nov 2007 04:05:02 +0100 |
User-agent: |
claws-mail.org |
Magnus:
> It is the zenity --text-info --editable dialog that has
> troubble when encountering at least "%f" (%F seemes OK).
What is %F ?
I can launch mimeedit without argument from commandline.
So i inserted %F in settings after path to mimeedit. (Lets'a abbreviate it m.e.)
However, clicking on Settings - >edit mimetypes still doesn't launch.
xession log shows mimeedit 'usage' saying it expects an argument.
> Gnome Commander calls "gnome-file-types-properties".
ok.
> > I tried to switch 'eog' to 'gqview.desktop' for jpg files however it didn't
> > work.
>
> What? "eog" is a command, "gqview.desktop" is not.
sloppy language, pls excuse. of course eog.desktop
ok...i did some testing. Here's the log...i hope you can draw some conclusions
of it.
About launching without argument.
When i launch m.e. from commandline without argument, the 'program selector'
pops up.
Selecting kde-amarok.desktop gives empty window.
I remember i copied the /usr/share/applications/kde/amarok.desktop file and
erased unneccesary international naming stuff.
Here is the actual content:
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Amarok
GenericName=Audio Player
Exec=amarok %U
Comment=Rocks.
Icon=amarok
X-KDE-Protocols=http
MimeType=audio/aac;audio/mp4;audio/mpeg;audio/mpegurl;audio/vnd.rn-realaudio;audio/vorbis;audio/x-flac;audio/x-mp3;audio/x-mpegurl;audio/x-ms-wma;audio/x-musepack;audio/x-oggflac;audio/x-pn-realaudio;audio/x-scpls;audio/x-speex;audio/x-vorbis;audio/x-wav;video/x-ms-asf;
DocPath=amarok/index.html
Terminal=false
Categories=Qt;KDE;AudioVideo;Audio;Player;
(%U - is that a problem?)
As a sidenote, i'm slightly confused. Do you know why some mimetypes are like
x-* (like x-mp3) while others are like audio/mpeg ? While there is no audio/mp3.
However, i see audio/vorbis and additionally audio/x-vorbis...
Is there a complete list of all known mimetypes anywhere ?
Here is my users applications directory list:
defaults.list
mimeinfo.cache
iceweasel.desktop
Google-googleearth.desktop
ktorrent-usercustom.desktop
vlc-usercreated.desktop
file-roller-usercreated.desktop
mcview-usercreated.desktop
gedit-usercreated.desktop
dillo-usercreated.desktop
firefox-usercreated.desktop
kde-amarok.desktop
xpdf-usercreated.desktop
xzgv-usercreated.desktop
mcedit-usercreated.desktop
nedit-usercreated.desktop
evince-usercreated.desktop
eog-usercreated.desktop
exrdisplay-usercreated.desktop
gliv-usercreated.desktop
gqview-usercreated.desktop
gv-usercreated.desktop
xine-usercreated.desktop
I attach defaults.list and mimeinfo.cache. Note the [] headers!
Some general notes about the selector:
- After selecting an app (and possibly editing) the script exits.
Perhaps it's more convenient to return to selector ? Because, after editing one
file a user could get the idea to edit more.
- The mimeinfo and default files aren't sorted, somehow sucking if you search
for something visually. Your script would be a good hook-in to do that, as a
nice side-effect :)
You could apply sort -u (just to be on the safe side). (Don't forget the header)
> Have you made any associations with file extensions?
> That is possible too you know, and that takes precedence
> over the mimetype and should thus be avoided if possible.
Here's something i note since long.
As a test case, let's focus on mp3: I can't the heck get gcmd launch amarok by
default. It always launched audacity. gcmd reports that as default app.
However, i have amarok in defaults and mimeinfo for mpeg, and no audacity
anywhere at all. Yet gcmd Alt+Enter reports audio/mpeg as mimetype. But m.e.
has amarok 'marked'.
What means "FASLE vlc.desktop" ? What means "soundconverter No_name" ?
It also has a checkbox with an empty line at the end.
I tried m.e. on an mp3 file and modified the default to audacity. That was
applied correctly in mimeinfo and defaults. I repeated that setting amarok
again. Also applpied correctly.
gcmd still reports audacity for audio/mpeg, and launches it accordingly.
Is this a bug ?
> You can also delete your ~/.local/share/applications directory and start
> fresh.
> (you could have a messed up dir)
I tried that.
After relaunching amarok (hoping it would create a new entry), i still have no
kde-amarok in the folder. I conclude that's only created on user request, by a
filemanager like nautilus (or now, m.e.).
I also restarted the session. Clicking a mp3 in gcmd still opens audacity
again, with ~/.local/share/applications still empty. Give me a brick.
My theory: The kde-amarok entry somehow is bad. Therefore the next application
would be chosen. However, there is none defined by user so /etc/mailcap is
used. There's indeed that audacity entry, and none for amarok. Since i don't
want to fiddle with mailcap at all, i tried to setup a new amarok entry with
m.e.
(btw there's a message text artefact on top of that dialog '...separate them
with a colon' is redundant) but it says 'audio/mpeg already is assigned to
amarok'. Yet it displays audacity checked ! When i checked kde-amarok instead,
it says 'dafult was not changed'.
Later, it still shows audacity as default. The relevant files still contain
amarok.
Why does it show audacity now as default ?
Interesting. I renamed kde-amarok.desktop to just amarok.desktop but m.e. still
has the old kde-amarok entry (and missing the new one).
Restarting gcmd didn't change that fact.
Then i also deleted the pointer entries in mimeinfo and defaults, and again
restarted gcmd.
Still m.e. shows kde-amarok...!
ok. I restarted the session.
m.e. still shows kde-amarok!
I removed the audio/x-mp3 entry in defaults.list - still kde-amarok.
I removed that entry in mimeinfo.cache - still kde-amarok !
(there was a [Default Applications] header artefact in mimeinfo now, sonewhere
in between, additionally to the regular [MIME Cache] header -- i remember to
have seen that before. Is that m.e. putting it there ?)
I replaced any kde-amarok.desktop entry by amarok.desktop, and restarted gcmd.
Now...amarok is launched as default, by gcmd! But m.e. still shows kde-amarok
FALSE, and no amarok.desktop entry. It also shows MPlayer FALSE...
That'S weird though. Why without .desktop suffix ? Why FASLE ? There is no
mplayer desktop file, and no pointer entry at all, in any file, as a grep
reveals.
mplayer is installed of course. I can launch it via gmcd.
I restarted the session again (and this time ensured no gnome daemon still
running)
Yet m.e. has kde-amarok FASLE ...and even a grep could not find any kde-amarok
anywhere. Why does m.e. not show my amarok.desktop file ? It's in defaults and
mimeinfo, and work via gmcd now.
I launched m.e. selector (no args). It shows amarok, not kde-amarok.
However, trying to edit amarok.desktop doesn't work. stderr says,
cat: /usr/share/applications/amarok.desktop: No such file or directory
- so i assume m.e. looks for .desktop files in /usr/share.
ok, i accepted the unavoidable and for heavens sake renamed it to
amarok-usercreated.desktop. (I think, however, that any file in
~/.local/share/applications should be considered to be usercreated or
usercustom or whatever, just as a matter of facts, so the name should be
irrelevant)
....m.e. still has kde-amarok.
I give up ! It's very late and i already spent several hours on that.
And what about the subdirectory /usr/share/applications/kde ?
There's a lot of stuff stuff in:
arts.desktop
background.desktop
bell.desktop
cache.desktop
cdinfo.desktop
clock.desktop
colors.desktop
componentchooser.desktop
cookies.desktop
crypto.desktop
desktopbehavior.desktop
desktop.desktop
desktoppath.desktop
devices.desktop
display.desktop
dma.desktop
ebrowsing.desktop
filebrowser.desktop
filetypes.desktop
fonts.desktop
icons.desktop
installktheme.desktop
interrupts.desktop
ioports.desktop
ioslaveinfo.desktop
joystick.desktop
kappfinder.desktop
kcmaccess.desktop
kcmcgi.desktop
kcmcss.desktop
kcmfontinst.desktop
kcmkded.desktop
kcm_kdnssd.desktop
kcmkicker.desktop
kcmlaunch.desktop
kcmnotify.desktop
kcmperformance.desktop
kcmsmserver.desktop
kcmtaskbar.desktop
kcmusb.desktop
kcmview1394.desktop
KControl.desktop
kdm.desktop
keyboard.desktop
keyboard_layout.desktop
keys.desktop
kfontview.desktop
khotkeys.desktop
khtml_behavior.desktop
khtml_fonts.desktop
khtml_java_js.desktop
kinfocenter.desktop
knetattach.desktop
krandrtray.desktop
kthememanager.desktop
lanbrowser.desktop
language.desktop
media.desktop
memory.desktop
mouse.desktop
netpref.desktop
nic.desktop
opengl.desktop
panel_appearance.desktop
panel.desktop
partitions.desktop
pci.desktop
privacy.desktop
processor.desktop
proxy.desktop
screensaver.desktop
scsi.desktop
smbstatus.desktop
sound.desktop
spellchecking.desktop
style.desktop
useragent.desktop
xserver.desktop
ktorrent.desktop
kresources.desktop
digikam.desktop
audiocd.desktop
kaudiocreator.desktop
kfilereplace.desktop
kimagemapeditor.desktop
klinkstatus.desktop
kmdr-editor.desktop
kxsldbg.desktop
libkcddb.desktop
quanta.desktop
amarok.desktop
krename.desktop
krusader.desktop
krusader_root-mode.desktop
No kde-amarok...i think i gcopied that file some months ago, and they removed
it meanwhile (replacing it by just amarok.desktop), as there are no other kde-*
files anymore.
I wonder about the above kde files. For example the arts entry says
Exec=kcmshell arts, but i have no arts installed. There's another entry
'audiocd' with Exec=kcmshell audiocd, but there's no program of that name. You
can also see 'colors' and 'bell' and 'cookies' and 'dma' and such stuff. Even a
desktop.desktop entry, (which contains a 'Docpath' entry launching kcontrol and
siplaying some index.html file.)
This all looks like internal kde proxies/frontends (e.g. providing that
inserted audiocd will be recognized and autplayed).
I can see no kde file at all in /usr/share/applications, with 2 exceptions:
qt4config (not strictly a kde app) and k3b, which - funny enough - has no
entry in the kde subfolder.
Maybe it's no more seen as strict kde app.
Magnus, i don't like to shock you even more, but i feel obliged to mention that
there seems to exist yet another system in /usr/share/application-registry.
Folder listing:
openoffice.applications
mplayer.applications
gimp.applications
java-archive.applications
java-web-start.applications
gnome-vfs.applications
cinepaint.applications
gqview.applications
inkscape.applications
For example, gimp entry looks like
gimp
command=gimp-2.4
name=GNU Image Manipulation Program
can_open_multiple_files=true
expects_uris=non-file
requires_terminal=false
supported_uri_schemes=file,http,ftp
mime_types=image/bmp,image/g3fax,image/gif,image/jpeg,image/png,image/tiff,image/x-bmp,image/x-compressed-xcf,image/x-pcx,image/x-png,image/x-portable-anymap,image/x-portable-bitmap,image/x-portable-graymap,image/x-portable-pixmap,image/x-psd,image/x-sun-raster,image/x-tga,image/x-xbitmap,image/x-xcf,image/x-xpixmap,image/x-xwindowdump
Another weird thing is, there isn't any /usr/share/amarok folder, but usually
packages have some shared default files like themes, icons there. There are
e.g. bluefish, claws-mail, or audacity, and many many others (including all
debian tools.)
However, there's /usr/share/apps and there is amarok, k3b, digikam, quanta,
krusader, and all the other kde stuff. And a folder LICENSES with gpl,
artistic, bsd licenses...
To me that all looks like either KDE doesn't interpret freredesktop like gnome,
or maybe they just aren't ready for that by now. This is KDE 3.5.8.
Not to mention googleearth - they have a desktop entry now in the right place
now, but there's still this ~/.local/share/mime folder with its own structure.
I believe this is an obsolete artefact now, and i'll try out if i can delete it
safely.
-- I moved back my previous 'applications' folder for the time being. I added
much stuff there, especially weird mimetypes (like audio/aac or video/3gp, for
noka mobile files) and i would appreciate not having to put it up again from
scratch.
I would really like to know how to start the 'selector' from gcmd via
Settings-Edit mimetypes. And i like to know a more efficient way to test m.e. -
do i always have to restart gcmd, or restart the session ?
defaults.list
Description: Binary data
mimeinfo.cache
Description: Binary data