Filesystem Hack: Set Identity to Whatever You Want
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Filesystem Hack: Set Identity to Whatever You Want
Pretty awesome! (Apart from not being able to open files)
Re: Filesystem Hack: Set Identity to Whatever You Want
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:
This also fixes a problem when the Windows install wasn't located at C:
- Attachments
-
- File Explorer.love
- Version 1.1 - More platform independant
- (1.21 KiB) Downloaded 84 times
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Filesystem Hack: Set Identity to Whatever You Want
That's better. The command for Mac is "open".
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: Filesystem Hack: Set Identity to Whatever You Want
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
Does it work for both Linux and Mac?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
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Filesystem Hack: Set Identity to Whatever You Want
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.kalle2990 wrote:Does it work for both Linux and Mac?nevon wrote:Code: Select all
xdg-open
Help us help you: attach a .love.
Re: Filesystem Hack: Set Identity to Whatever You Want
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.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.
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: Filesystem Hack: Set Identity to Whatever You Want
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).kalle2990 wrote:Does it work for both Linux and Mac?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
Re: Filesystem Hack: Set Identity to Whatever You Want
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.
xdg-open is an executable that's provided by the current desktop environment of the user, provided it follows the Freedesktop.org standard.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Filesystem Hack: Set Identity to Whatever You Want
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".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 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.
Who is online
Users browsing this forum: No registered users and 131 guests