Skip to content

enhance: support tools installed via flatpak #1517

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
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

NathanBaulch
Copy link
Contributor

This PR is a bit experimental.
I have various tools installed via Flatpak (Meld, VSCodium, etc) that I'd like sourcegit to integrate with. Currently all diff and merge tools must resolve to a known binary file, whereas Flatpak apps are launched via the flatpak binary (eg flatpak run org.gnome.meld). I've figured out some workarounds to get ExternalTool and ExternalMerger working but I'm reluctant to make any significant changes because I can only test on Linux.

@love-linger love-linger self-assigned this Jul 5, 2025
@love-linger love-linger added the not-planned It's not planned in the future label Jul 5, 2025
@love-linger
Copy link
Collaborator

love-linger commented Jul 5, 2025

I suggest directly creating a command-line tool for Flatpak applications, so it can be used as normal application. For example:

  1. Create /usr/bin/meld,and fill it with following contents:
#!/bin/bash

/usr/bin/flatpak run org.gnome.meld $@
  1. Change the file mode with chmod u+x /usr/bin/meld

@NathanBaulch
Copy link
Contributor Author

Digging deeper, it looks like Flatpak already does this for me! Specifying the following install path works for my per-user Meld installation: /home/nathan/.local/share/flatpak/exports/bin/org.gnome.meld 👍
It would be cool if sourcegit could figure this out automatically, but at least I have something workable.
It would also be cool if it could automatically detect these in ExternalTool, which is not something I can override in preferences.

@NathanBaulch
Copy link
Contributor Author

I've updated this PR with much cleaner Flatpak external tool support based on inspecting the system-wide and per-user flatpak/exports/bin folders. Changes are limited to Linux.cs and ExternalMerger is no longer touched.

If sourcegit can have special support for JetBrains Toolbox then it seems reasonable that it can also support Flatpak on Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-planned It's not planned in the future
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants