Gentoo Archives: gentoo-user

From: Damian <damian.only@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Xmonad, beagle-search, and mime types
Date: Sun, 21 Feb 2010 20:08:30
Message-Id: 47a330c51002211123p58cc8caexe30da1f7bb38bf3a@mail.gmail.com
In Reply to: Re: [gentoo-user] Xmonad, beagle-search, and mime types by YoYo siska
1 On Sun, Feb 21, 2010 at 6:50 PM, YoYo siska <yoyo@××××××.sk> wrote:
2 > On Sun, Feb 21, 2010 at 05:33:35PM +0100, Damian wrote:
3 >> On Sun, Feb 21, 2010 at 4:05 PM, Willie Wong <wwong@××××××××××××××.edu> wrote:
4 >> > On Sun, Feb 21, 2010 at 03:45:14PM +0100, Damian wrote:
5 >> >> So I tried to see how xdg-open works, but the man page didn't give me
6 >> >> any useful information. The related command, xdg-mime, doesn't work as
7 >> >> I expected.
8 >> >
9 >> > I asked a similar question a week or so back.
10 >> I searched in my mails but I couldn't find it. Sorry, I probably
11 >> didn't enter a relevant search string.
12 >>
13 >> >> But xdg-open (and therefore beagle-search) still refuses to open jpeg
14 >> >> images with geeqie.
15 >> >>
16 >> >> Any ideas?
17 >> >
18 >> > xdg-open is just a shell script. If you are interested, take a look at
19 >> >  less `which xdg-open`
20 >> > and you will be enlightened as to why it is a complete piece of crap
21 >> > unless you are using KDE, GNOME, or XFCE. (Hint, notice how nowhere in
22 >> > the script does it read whatever you modified with xdg-mime.)
23 >> >
24 >> > A possible way to work around it (depends on your application, which,
25 >> > in your case, is beagle, which I am not familiar with) is to go into
26 >> > the offending application that is calling xdg-open and see if you can
27 >> > configure MIME types in there yourself. The application that made me
28 >> > look this up, Jabref, does allow that configuration. Your mileage can
29 >> > of course vary.
30 >> Thanks Willie for your answer.
31 >>
32 >> Sadly beagle-search doesn't offer any option. The developers must use
33 >> only gnome.
34 >>
35 >> I guess I will have so find another beagle front end, or choose a
36 >> different desktop search engine.
37 >
38 > xdg-open tries to determine the desktop enviroment you are running and
39 > uses its way to open files...
40 > If you are in a kde session, it will just run kfmclient XXX (kde way to
41 > open files in their application), for gnome it will use gnome-open or
42 > something...
43 >
44 > So even if you are not logged in a "full" gnome or kde session, but have
45 > some of its packages installed, you can "trick" xdg-open to use that
46 > enviroment
47 > for kde just export KDE_FULL_SESSION=true,
48 > for gnome GNOME_DESKTOP_SESSION_ID=something
49 >
50 > so you can run beagle-search with
51 > GNOME_DESKTOP_SESSION_ID=something beagle-search
52 >
53 > you have to  set which applications to use in corresponding config
54 > (for kde, just run konqueror/dolphin and right click a file, don't know
55 > for gnome)
56 >
57 > for kde, you need the package kde-base/kfmclient, which should depend
58 > juast on kdelibs, for gnome-open you need gnome-base/libgnome, which
59 > shouldn't have much dependences that you don't have allready if you have
60 > some gtk app..
61 >
62 > btw, gnome-open/kfcmclient will open files in any available program that
63 > correctly registers its mime-types, not only in kde/gnome apps..., so
64 > you really need only kfmclient/libnome to use it...
65 >
66 >
67 > one last remark, if set KDE_FULL_SESSION/GNOME_DESKTOP_SESSION_ID for
68 > xdg-open and it starts a gnome/kde app, that app might think that there
69 > are some desktop specific things running, that are not, though I haven't
70 > seen any real problems with it...
71 > You might however just edit the "detectDE" function in xdg-open to
72 > always behave like gnome/kde without settings the variables...
73 >
74 > yoyo
75 >
76 >
77 > PS the idea of xdg-open using a browser, when it cannont detect which DE
78 > are you running, is that a browser usually knows how to open which
79 > files... and you should have your preffered browser set in $BROWSER...
80 Thanks a lot for that nice explanation.
81
82 I've exported export BROWSER=gnome-open, and this way I could fix my problem.
83
84 Regards,
85 Damian.