Nautilus - Support for nautilus scripts?

expected outcome: nautilus script runs
output: no output / action of any kind

Nautilus supports extensions, and also simple scripts, under “$HOME/.local/share/nautilus/scripts/” on conventional imperative systems. My simple scripts under this directory are seen by nautilus, but don’t work.

I noticed there’s a patch for extensions ( - would a similar patch be needed for scripts? Has someone managed to get nautilus scripts to work, and if so, what steps were needed?


Just tried creating ~/.local/share/nautilus/scripts/ with the following contents and making it executable and it works:

#!/usr/bin/env bash
for f in "$@"; do
	echo "- $f" >> test.log

Make sure the interpreter exists and all dependencies are available. Notably, NixOS does not have anything in /usr/bin other than env, and /bin only contains sh.

And if it depends on more than just programs on PATH, you might need to package the script similarly as described in How is XDG_DATA_DIRS set for some apps? - #6 by jtojnar.

1 Like

I indeed hadn’t updated my shebang(s) to invoke bash via env; a few replacements later and they’re all working fine.

For anyone else in a similar situation of confusion to mine, jtojnar’s linked resource is great, as is the additional resource linked within it at the bottom.

Thank you again!