Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open XiEditor from the command line #111

Closed
cmyr opened this issue Jan 11, 2018 · 8 comments
Closed

open XiEditor from the command line #111

cmyr opened this issue Jan 11, 2018 · 8 comments

Comments

@cmyr
Copy link
Member

cmyr commented Jan 11, 2018

We'd like this eventually. In the interim, I currently have a teeny bash script at /usr/local/bin/xi:

#! /bin/sh
open -a XiEditor $@

This requires XiEditor to be installed somewhere, like /Applications. You can also replace XiEditor with a path to the app bundle.

edit: simplified script

@vlovich
Copy link
Contributor

vlovich commented Jan 31, 2018

Are you saying eventually you want a terminal front-end or just the ability to invoke the Gui from the command-line? If it's the latter we can just package your script into the .app & on startup check for /usr/local/bin/xi - if missing copy it there.

@cmyr
Copy link
Member Author

cmyr commented Jan 31, 2018

@vlovich Right, I'm talking about essentially packaging this script; I had the idea that it might make sense to add various options, but that can be future work. I'm not sure how best we would go about installing this; we don't necessarily know the path to the XiEditor.app package. There's probably a way to figure this out, I don't really know much about the mac app install process...

@srigsby
Copy link

srigsby commented Feb 6, 2018

perhaps not useful but this is the alias I use for "opening XiEditor from the [cmd] line":

alias xi="open -a $HOME/xi-mac/build/Release/XiEditor.app"

@WillCraig
Copy link

WillCraig commented Feb 15, 2018

I wanted to make a more detailed set of instructions for idiots like myself (Who took 4 hours to get this to work)
type open .profile in the terminal, put this in the .profile file

alias xi ="open /path/to/xieditor.app"

type source .profile after saving the text file

(*You can change the name of the alias to anything you want.

@vlovich
Copy link
Contributor

vlovich commented Feb 23, 2018

This is typically done on OSX by bundling the script into the .app & then offering an option to deploy it into /usr/local/bin if it's not present. Would be happy to accept a PR that does this.

@OberstKrueger
Copy link

Absent a smarter method of finding the location of XiEditor.app, the "/Applications" portion of the script can be left off. By default, "open -a" will search both /Applications and ~/Applications, and while I imagine most people will put it in the root Applications, there might be some who put it in the user Applications folder.

@jansol
Copy link
Contributor

jansol commented Aug 7, 2018

In fact it's even smarter: it will remember the location of the .app if it has been launched before (which it has to be in #242) so it doesn't even have to be in Applications.

@jansol
Copy link
Contributor

jansol commented Aug 20, 2018

There's a menu item for installing the helper script mentioned in the OP now.

@jansol jansol closed this as completed Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants