DEV Community

Piotr
Piotr

Posted on • Originally published at garden.piotrk.it on

Setting obsidian-shellcommands plugin on flatpak

Running Obsidian from flatpak comes with its own set of problems. One of them is that Obsidian is ran in sandbox environment - which makes sense when we consider security, but to be frank - it’s annoying when I have to do something non-standard.

I wanted to run this command from obsidian (it updates my git repo):

npx quartz sync --no-pull
Enter fullscreen mode Exit fullscreen mode

but after adding it to there:

I was welcomed with an error that it couldn’t find npx command, which makes sense - I’m using NVM to manage node.

Tip

To make it work I had to make sure that npx was added to Obsidians $PATH variable and obsidian has permissions to this directory.

I used Flatseal to:

  1. Give Obsidian permissions to /home/$USER directory - that’s where bin/ of NVM resides
  2. Add NVM to $PATH:

I also had to update the script to execute from the git root:

cd "$(git rev-parse --show-toplevel)" && npx quartz sync --no-pull
Enter fullscreen mode Exit fullscreen mode

Now running Ctrl + P and typing Update page updates the page directly from obsidian.

Image of Quadratic

AI, code, and data connections in a familiar spreadsheet UI

Simplify data analysis by connecting directly to your database or API, writing code, and using the latest LLMs.

Try Quadratic free

Top comments (0)

AWS Industries LIVE! Stream

Business benefits of the cloud

Join AWS experts and tech leaders as they discuss the business impact of the cloud on Industries LIVE!

Learn More