I have made an image viewer in python. And I want to use it to view images from my folders. I have made a bash file, which would start the image viewer. Now I am stuck. When I right click on an image, and choose option “open with” and provide bash file(above mentioned file, to start image viewer), what arguments/parameters (if any) does it pass to bash script ?
I am using Arch Linux. My Desktop environment is Gnome + Awesome. My File Manager is Nautilus.
I have stopped using bash file(which I have mentioned earlier in the question).
I have added
#!/usr/bin/python2
and made it executable.
It’s working in terminal.
I have added alias in .bashrc as
alias imview='~/./image-viewer.py'
When used imview in terminal, it works.
But when I add imview you in “open with” command line, A new tab opens, but then it doesn’t work. And it hides after few seconds.
Any idea what could be the problem ?
You don’t need a Bash script to start your image viewer. Instead add this as your first line in the Python script:
And also make the Python script executable.
Then you will be able to run the script directly.
If you select “Open with…” then the filename should the be first argument to the script (
sys.argv[1]).