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

Set VScodium flatpak as default diff tool #4085

Closed
2 tasks done
laguill opened this issue Nov 12, 2024 · 11 comments
Closed
2 tasks done

Set VScodium flatpak as default diff tool #4085

laguill opened this issue Nov 12, 2024 · 11 comments
Labels
support Support request

Comments

@laguill
Copy link

laguill commented Nov 12, 2024

What exactly are you trying to do?

I would like to set vscodium flatpak as my default diff tool.
I already have an alias

# codium
alias codium='flatpak run com.vscodium.codium'

Here is the content of my chezmoi.toml

[diff]
command = "flatpak run com.vscodium.codium" # Tried also with codium
args = ["--wait", "--diff"]

When I run chezmoi diff ~/.bashrc I am getting this error

chezmoi: .bashrc: exec: "flatpak run com.vscodium.codium": executable file not found in $PATH

Thanks for your help

@laguill laguill added the support Support request label Nov 12, 2024
@KapJI
Copy link
Contributor

KapJI commented Nov 12, 2024

"flatpak" is the command, everything else is args.

@twpayne
Copy link
Owner

twpayne commented Nov 12, 2024

"flatpak" is the command, everything else is args.

Exactly. The config needs to be

[diff]
    command = "flatpak"
    args = ["run", "com.vscodium.codium", "--wait", "--diff"]

@laguill
Copy link
Author

laguill commented Nov 12, 2024

Thansk now codium is opening but I still have an error on the window
image

Shoud I edit some filesystem variable with flatseal ? or something else ?

@halostatue
Copy link
Collaborator

You may want to change your command to "echo" and see what the parameters are and then try to call flatpak with that. From this point, though, it's purely a flatpak issue.

@laguill
Copy link
Author

laguill commented Nov 12, 2024

ok so I changed my chezmoi.toml file with

[diff]
    command = "echo"
    args = ["flatpak", "run", "com.vscodium.codium", "--wait", "--diff"]

now here is the output of chezmoi diff

flatpak run com.vscodium.codium --wait --diff /home/laguill/.bashrc /tmp/chezmoi-diff848018656/.bashrc

I tried to add the ~/.local/share/chezmoi to codium but without better results

@laguill
Copy link
Author

laguill commented Nov 12, 2024

I manually tried to diff both files and did not get any error
flatpak run com.vscodium.codium --wait --diff ~/.bashrc ~/.local/share/chezmoi/dot_bashrc

@halostatue
Copy link
Collaborator

Yes. chezmoi diff always uses a temporary file because it needs to compare the result of templating.

You will need to determine what is required to give flatpak access to the temporary file.

@twpayne
Copy link
Owner

twpayne commented Nov 12, 2024

You will need to determine what is required to give flatpak access to the temporary file.

You can also set chezmoi's tempDir configuration variable to a directory that Flatpak permits VSCodium to access.

@laguill
Copy link
Author

laguill commented Nov 12, 2024

It seams that flatpak does not allowed /tmp
For cleaness or security I am not really sure see issue flatpak#3438

How do you change tempDir to /var/tmp ?

@twpayne
Copy link
Owner

twpayne commented Nov 12, 2024

How do you change tempDir to /var/tmp ?

Put

tempDir = "/var/tmp"

in ~/.config/chezmoi/chezmoi.toml. Make sure it's near the start of the file, in the top level config section.

@laguill
Copy link
Author

laguill commented Nov 13, 2024

It is working now thank you for your help

Here is the content of ~/.config/chezmoi/chezmoi.toml

tempDir = "/var/tmp"

[diff]
    command = "flatpak"
    args = ["run", "--user", "com.vscodium.codium", "--wait", "--diff"]

@laguill laguill closed this as completed Nov 13, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
support Support request
Projects
None yet
Development

No branches or pull requests

4 participants