[solved] Can't get xdg-open to work with .love files

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
clofresh
Citizen
Posts: 87
Joined: Sun Jul 26, 2009 4:21 pm
Contact:

[solved] Can't get xdg-open to work with .love files

Post by clofresh »

Hi, I'm on arch linux running awesomewm without a desktop environment and have installed the love package, but I can't seem to get xdg-open to open .love files. This is what I tried:

Code: Select all

$ pacman -Q love
love 0.9.2-1
$ cat /usr/share/mime/packages/love.xml 
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
        <mime-type type="application/x-love-game">
                <comment>LÖVE game</comment>
        <glob pattern="*.love"/>
        </mime-type>
</mime-info>
$ sudo update-mime-database /usr/share/mime
$ cat /usr/share/applications/love.desktop 
[Desktop Entry]
Name=LÖVE
Comment=The unquestionably awesome 2D game engine
MimeType=application/x-love-game;
Exec=/usr/bin/love %f
Type=Application
Categories=Development;Game;
Terminal=false
Icon=love
NoDisplay=true
$ xdg-mime default love.desktop application/x-love-game
$ xdg-open Eyebrella.love 
xdg-open: no method available for opening 'Eyebrella.love'
Any suggestions?
Last edited by clofresh on Sun Apr 26, 2015 12:31 am, edited 1 time in total.
----------------------------------------
Sluicer Games
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Can't get xdg-open to work with .love files

Post by bartbes »

What does the following command say?

Code: Select all

xdg-mime query Eyebrella.love
User avatar
clofresh
Citizen
Posts: 87
Joined: Sun Jul 26, 2009 4:21 pm
Contact:

Re: Can't get xdg-open to work with .love files

Post by clofresh »

Hmm interesting, it sees it as a zip. Wonder how it's getting that

Code: Select all

$ xdg-mime query filetype Eyebrella.love 
application/zip
----------------------------------------
Sluicer Games
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: Can't get xdg-open to work with .love files

Post by s-ol »

clofresh wrote:Hmm interesting, it sees it as a zip. Wonder how it's getting that

Code: Select all

$ xdg-mime query filetype Eyebrella.love 
application/zip
well, it is a zip, but the pattern matching should/could match it to löve before the file-inspection works.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Can't get xdg-open to work with .love files

Post by bartbes »

Interesting, it seems if xdg-mime can't detect a DE, it falls back to 'file', which uses its own filetype database. The gnome-open command does work for me (I run awesome on arch too).

You can verify this happens by running:

Code: Select all

bash -x xdg-mime query filetype Eyebrella.love
User avatar
clofresh
Citizen
Posts: 87
Joined: Sun Jul 26, 2009 4:21 pm
Contact:

Re: Can't get xdg-open to work with .love files

Post by clofresh »

Ah didn't know it was just a bash script. This makes it work:

Code: Select all

alias xdg-open='DE=gnome xdg-open'
xdg-open Eyebrella.love 
----------------------------------------
Sluicer Games
User avatar
Rucikir
Party member
Posts: 129
Joined: Tue Nov 05, 2013 6:33 pm

Re: [solved] Can't get xdg-open to work with .love files

Post by Rucikir »

Hi !
This is a bit necroposting, but I had the exact same issue.

Another solution is to install a xdg-open alternative like perl-file-mimeinfo.
Most importantly, xdg-utils apps will actually call mimetype instead of file for MIME type detection, if it does not detect your desktop environment. This is important because file does not follow the XDG standard.
.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 4 guests