Coder Social home page Coder Social logo

Comments (20)

mic-e avatar mic-e commented on April 28, 2024

Expanding ~ the is shell's job. It's not expanded because in your invocation it's in the middle of the string.

You can instead use openage --data "~/.openage/assets", or openage --data="$HOME/.openage/assets".

from openage.

boombatower avatar boombatower commented on April 28, 2024

That's what I thought, but didn't seem to be working the way I expected. As makes sense now it appears the = sign messes things up since it can then parse the individual parts. So for example the following works:

openage --data ~/.openage/assets

The reason I added the quotes was the desktop file validator complained without them.

Assuming it doesn't like the above I think

"$HOME/.openage/assets"

with or without the equal sign is probably the best bet.

from openage.

boombatower avatar boombatower commented on April 28, 2024

The error I get if I do with or without equal, but with ~ outside of quotes is:

$ desktop-file-validate dist/openage.desktop 
dist/openage.desktop: error: value "openage --data ~/.openage/assets %u" for key "Exec" in group "Desktop Entry" contains a reserved character '~' outside of a quote

from openage.

boombatower avatar boombatower commented on April 28, 2024

Hmm, doesn't like $HOME either. and escape it obviously interprets as literal $.

$ desktop-file-validate dist/openage.desktop 
dist/openage.desktop: error: value "openage --data="$HOME/.openage/assets" %u" for key "Exec" in group "Desktop Entry" contains a non-escaped character '$' in a quote, but it should be escaped with two backslashes ("\\$")

from openage.

boombatower avatar boombatower commented on April 28, 2024

Even more fun with single quotes.

$ desktop-file-validate dist/openage.desktop 
dist/openage.desktop: error: value "openage --data='$HOME/.openage/assets' %u" for key "Exec" in group "Desktop Entry" contains a reserved character ''' outside of a quote
dist/openage.desktop: error: value "openage --data='$HOME/.openage/assets' %u" for key "Exec" in group "Desktop Entry" contains a reserved character '$' outside of a quote
dist/openage.desktop: error: value "openage --data='$HOME/.openage/assets' %u" for key "Exec" in group "Desktop Entry" contains a reserved character ''' outside of a quote

from openage.

boombatower avatar boombatower commented on April 28, 2024

I guess that's why you see loads of applications shipping with a core shell script. Then we could do something like...

Exec=openage.sh

Where openage.sh contains:

openage  --data ~/.openage/assets

from openage.

boombatower avatar boombatower commented on April 28, 2024

That or the asset manager should just be told a mode and it figures out where to look?

from openage.

boombatower avatar boombatower commented on April 28, 2024

The validator seems to also add

#!/usr/bin/env xdg-open

Which I've seen before and seems to match official spec, yet most projects and ones on my system don't have it.

from openage.

boombatower avatar boombatower commented on April 28, 2024

Ok, I figured out semi clever solution. Setting path, which will expand as expected. Obviously a load of different way to do this, but this seems sensible...and best of all it actually works (assuming you setup data, which I have symbolically link to dev clone).

[Desktop Entry]
Exec=openage --data=assets %u
Path=~/.openage/

Everyone good with that? Also means any config will be in working directory.

from openage.

boombatower avatar boombatower commented on April 28, 2024

Meh, except it prints a warning...not an error though!?

$ desktop-file-validate dist/openage.desktop                                 
dist/openage.desktop: warning: value "~/.openage/" for key "Path" in group "Desktop Entry" does not look like an absolute path

from openage.

boombatower avatar boombatower commented on April 28, 2024

Seems that openage will not load without a terminal available? One has to add

Terminal=true

for .desktop file to work

Spawned #106.

from openage.

lilezek avatar lilezek commented on April 28, 2024

I use $HOME/.openage/assets as my data folder and it works without any problem. As mic-e said, it is shell's work.

from openage.

boombatower avatar boombatower commented on April 28, 2024

Past that, read the comment. Issues are specific to .desktop files.

from openage.

TheJJ avatar TheJJ commented on April 28, 2024

This is the shell's job, why do these damn freedesktop files ignore homedirs? Maybe they have some special replacement format chars, using args and homedirs seems to be a common usecase..

from openage.

franciscod avatar franciscod commented on April 28, 2024

http://stackoverflow.com/a/2552458

*nix: getenv("HOME")
Windows: getenv("HOMEDRIVE") ++ getenv("HOMEPATH")

from openage.

TheJJ avatar TheJJ commented on April 28, 2024

Kay, good idea. For the per-user dir that seems to be the way to go.

from openage.

lilezek avatar lilezek commented on April 28, 2024

I suggest to convert assets into that folder already. It doesn't make any sense that the folder created for the assets is not the program is using by default. Another way to go would be let the user input a path and then the converter writes down a config file ready to be read from openage, containing the path.

from openage.

TheJJ avatar TheJJ commented on April 28, 2024

Yes, i'll try to invoke the conversion from the game binary as soon as possible (#29), the destination folder will be updated then.

from openage.

TheJJ avatar TheJJ commented on April 28, 2024

The problem is the quotation. If you write --data=~/lol/folder/ it works, your shell just does not expand it in the quotation mark.

from openage.

boombatower avatar boombatower commented on April 28, 2024

yah didn't read my comments....we can close this.

from openage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.