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

Add script to show neovide as an option in "Open With" menus #1563

Closed
wants to merge 1 commit into from

Conversation

n8henrie
Copy link

What kind of change does this PR introduce?

  • Feature

Did this PR introduce a breaking change?

A breaking change includes anything that breaks backwards compatibility either at compile or run time.

  • No

Addresses #1562

@n8henrie
Copy link
Author

NB: This is proof-of-concept at this point, pending discussion / review.

If it seems like a good idea and this implementation is reasonable, my plan would be to:

  1. Move the logic from
    - name: Merge into a universal app
    to e.g. scripts/build_macos.sh, which will make it easier for users and devs to build their own copy locally instead of relying on GA
  2. Add this logic into that script to modify the Info.plist (prior to the codesign step)

Could also use some feedback regarding the filetypes that this would make the most sense for. The related issue links to the MacVim Info.plist for comparison, though its licensing might preclude following its example too closely.

@mgax
Copy link
Contributor

mgax commented Oct 21, 2022

I guess the natural place to set file types is through cargo-bundle, which is used to generate the app bundle, but it doesn't seem to have support.

MacVim has a long list of filetypes in its Info.plist. I'm not sure if we can copy it outright; it's licensed with the Vim License.

If we do use PlistBuddy to modify Info.plist, which TBH sounds like the best option, I suggest we try to copy the relevant content from a static .plist file in the repository into the app bundle plist.

@shaunsingh
Copy link
Collaborator

Sorry for the delay, script looks good to me so far

If it seems like a good idea and this implementation is reasonable, my plan would be to:
Move the logic from
neovide/.github/workflows/build.yml
Line 128 in 0b6e20c
- name: Merge into a universal app
to e.g. scripts/build_macos.sh, which will make it easier for users and devs to build their own copy locally instead of relying on GA
Add this logic into that script to modify the Info.plist (prior to the codesign step)

I'm completely fine with this, if we're straying away from cargo-bundle it makes sense to have a way for the user to build a bundle properly as well. You can also take advantage of the build.rs file if you'd like. Just make sure to update the documentation with the new steps for building a binary bundle on macOS

I guess the natural place to set file types is through cargo-bundle

While I'd personally prefer getting support for modifying Info.plist merged into cargo-bundle as well, it's not getting support anytime soon (burtonageo/cargo-bundle#33). Using PlistBuddy sounds like a good solution for now.

Regarding the Vim License, I believe as long as we include a copy of the vim license as a comment at the top of the plist file, it should be fine. I'll ping the macvim author (@ychin) for his opinion on it as well.

@ychin
Copy link

ychin commented Feb 1, 2023

I don't see a problem with the Vim license but then I'm not a copyright lawyer. I believe it should be compatible. Does Neovide not include anything Vim related to begin with? I guess you don't bundle Neovim (which is partially Vim licensed).

Which lines are you thinking of copying from MacVim btw? There are actually some issues with the Info.plist not properly setting up the UTIs (see macvim-dev/macvim#916 and macvim-dev/macvim#1169) and I'm ashamed to admit that I never looked into it and properly fixing them (keeps getting punted for "the next release" perpetually 😅). Just make sure you understand those issues before blindly copying.

@n8henrie
Copy link
Author

n8henrie commented Feb 5, 2023

Thanks for responses and feedback all around. It looks like my issue for this was closed with a note of going a different direction, so I'll close this PR as well.

@n8henrie n8henrie closed this Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants