Page 2 of 4

Re: Filesystem Hack: Set Identity to Whatever You Want

Posted: Mon May 23, 2011 8:26 pm
by BlackBulletIV
Pretty awesome! (Apart from not being able to open files)

Re: Filesystem Hack: Set Identity to Whatever You Want

Posted: Tue May 24, 2011 6:15 am
by kalle2990
After some experimenting with this under Ubuntu, and realizing I forced the use of C: before, I have rewritten the opening of files to use gnome-open if it sees that the system isn't Windows. If you're computer doesn't support gnome or isn't linux, you can change the open_command value to something of your liking ;)

This also fixes a problem when the Windows install wasn't located at C:

Re: Filesystem Hack: Set Identity to Whatever You Want

Posted: Tue May 24, 2011 6:58 am
by BlackBulletIV
That's better. The command for Mac is "open".

Re: Filesystem Hack: Set Identity to Whatever You Want

Posted: Tue May 24, 2011 7:31 am
by nevon
Use the following instead. That'll open the directory, file or URL in whatever the preferred application is:

Code: Select all

xdg-open

Re: Filesystem Hack: Set Identity to Whatever You Want

Posted: Tue May 24, 2011 3:31 pm
by kalle2990
nevon wrote:Use the following instead. That'll open the directory, file or URL in whatever the preferred application is:

Code: Select all

xdg-open
Does it work for both Linux and Mac?

Re: Filesystem Hack: Set Identity to Whatever You Want

Posted: Tue May 24, 2011 3:36 pm
by Robin
kalle2990 wrote:
nevon wrote:

Code: Select all

xdg-open
Does it work for both Linux and Mac?
Don't think so, XDG is what is now freedesktop.org is. They work on interoperability for desktop environments using X. Mac doesn't use X, so it doesn't work with that. OS X does provide the similar command "open", though.

Re: Filesystem Hack: Set Identity to Whatever You Want

Posted: Tue May 24, 2011 3:43 pm
by kalle2990
Robin wrote:Don't think so, XDG is what is now freedesktop.org is. They work on interoperability for desktop environments using X. Mac doesn't use X, so it doesn't work with that. OS X does provide the similar command "open", though.
Yeah, I read that the Mac command is "open" somewhere, and now both you and BlackBulletIV told me ;) I'll see if I can use the saving directory value to find out if it's either of those, as I just saw they are different on the wiki.

Re: Filesystem Hack: Set Identity to Whatever You Want

Posted: Tue May 24, 2011 3:44 pm
by nevon
kalle2990 wrote:
nevon wrote:Use the following instead. That'll open the directory, file or URL in whatever the preferred application is:

Code: Select all

xdg-open
Does it work for both Linux and Mac?
I should have been more specific. xdg-open would be a replacement for gnome-open. xdg-open will work in most Linux environments (and possibly BSD and what have you as well, but obviously Löve doesn't support those platforms).

Re: Filesystem Hack: Set Identity to Whatever You Want

Posted: Tue May 24, 2011 6:07 pm
by thelinx
Indeed. xdg-open is the preferred executable, since gnome-open will only work for users using gnome (obviously).

xdg-open is an executable that's provided by the current desktop environment of the user, provided it follows the Freedesktop.org standard.

Re: Filesystem Hack: Set Identity to Whatever You Want

Posted: Wed May 25, 2011 6:14 am
by BlackBulletIV
kalle2990 wrote:I'll see if I can use the saving directory value to find out if it's either of those, as I just saw they are different on the wiki.
I think the only way to detect whether the operating system is Mac is by checking a few common root folders that are on a Mac (and not on Linux, unless someone's creating new root folders for some reason), like "/Users", "/System", "/Applications", and "/Library".

I did suggest a while ago something like a love.platform variable which would greatly aid this sort of thing, but I don't think that was very successful because it would really only be useful in these sort of applications.