0

I am writing a python script that can be run as a Nautilus script (but not only).

I use setuptools. Imagine that in my setup.py I use entry_points that creates a command named my_nautilus_script (this is working well).

I would like that pip install my_nautilus_script also adds say a xxx.sh in ~/.local/share/nautilus/scripts/ which calls in turn my_nautilus_script command.

A few questions about that:

  1. Is it possible?
  2. Is it a good way to look at the problem? is there a better/cleaner alternative? of course, the user can be asked to create xxx.sh him/her-self... but this is not what I want.
  3. As a Nautilus script, my script is particularly intended for Linux users but not only. I do not want pip install to fail for Windows users).
sinoroc
  • 18,409
  • 2
  • 39
  • 70
zigma12
  • 181
  • 1
  • 7
  • 1
    Not possible. Not a good way to look at the problem. This is beyond Python packaging scope. I recommend you look into packaging tooling specific to the operating system (apt/deb, yum/rpm, pacman, msi, snap, etc.). – sinoroc Jul 31 '22 at 19:25
  • That's what I thought. On the other hand, I think apt/deb etc. are certainly overkill for my small project (even though this could be an opportunity for me to learn...) – zigma12 Jul 31 '22 at 19:40
  • Typically these things can also be done during the first run-time. https://stackoverflow.com/a/64459990 – sinoroc Aug 01 '22 at 21:47
  • OK but in that case (nautilus script) there will be no first run-time as long as the script is not placed in the right folder (vicious circle) – zigma12 Aug 04 '22 at 19:10

0 Answers0