gillescastel / inkscape-figures

Inkscape figure manager
MIT License
557 stars 119 forks source link

launching Inkscape on macOS #22

Closed adir-ux closed 2 years ago

adir-ux commented 4 years ago

Ctrl+f doesn't launch Inkscape, although it does create the file in the right position and with the right name (at least for the 1.0beta, the only version which is not dependent on xquartz yet).

Solution: in 'inkscapefigures' folder in 'main.py' file, inside 'def Inkscape(path):'

subprocess.Popen path is set to "/Applications/Inkscape,set(path)" while this would not work, as its not an executable file (at least that's the reason I found for), and must be changed to:

"/Applications/Inkscape.app/Contents/MacOS/inkscape",str(path)

works like a charm.

thanks a lot for all of your work and sharing. you made me learn ViM from scratch, and build an amazing notes taking machine. your articles and repository are pure gold!

gillescastel commented 4 years ago

Not familiar with MacOS, but I think the code as is should work if your path is setup correctly, so I'm hesitant to change it right now. What are your thoughts @pierreglaser?

pierreglaser commented 4 years ago

inkscape is not so straightfoward to install on MacOS, and I may have symlink-ed inkscape to some place in my $PATH at some point in the process when developing inkscape-figures MacOS suppport. Apologies if this ended up breaking your setup @adir-ux.

/Applications/Inkscape.app/Contents/MacOS/inkscape sounds like a reasonable place for an Inkscape executable to be on MacOS. But so is $PATH. So if we want to support the two, we will need some form of fallback mechanism. Is there any guidelines from the inkscape folks on how to launch inkscape from the command line in MacOS? If not, I would be slightly in favor of supporting @adir-ux 's situation.

adir-ux commented 4 years ago

if set to /Applications/Inkscape , would it check the PATH as well?

on Inkscape wiki I found this link to /usr/local/bin sudo ln -s /Applications/Inkscape.app/Contents/Resources/bin/inkscape /usr/local/bin

but running /Applications/Inkscape.app/Contents/Resources/bin/inkscape returns "no such file or directory", so I assume it applies only to the older xquartz versions.

someone on StackOverflow suggested the location I pointed. https://stackoverflow.com/a/60068607

gillescastel commented 4 years ago

Thanks for your input! Relevant Inkscape (outdated?) docs: MacOSX#Inkscape command line. A bit confusing to be honest. I think we should probably

  1. check if inkscape is in the path (checkout return code of which inkscape)
  2. check if /Applications/Inkscape.app/Contents/Resources/bin/inkscape exists
  3. check if /Applications/Inkscape.app/Contents/MacOS/inkscape exists,

and depending on that execute the right file. Sounds good?

adir-ux commented 4 years ago

sounds great.

gillescastel commented 4 years ago

Moved off-topic conversation to issue #23.