So for a course I'm taking in operating systems I've chosen to integrate a custom ftp-like program into the right click menu (written in C) and I've been having problems with trying to get the scripts I've made appear and work the way I want them to.
The goal is to make it appear as integrated into the OS as possible. I've found a topic on how to add an action in the regular right click menu but I've been having trouble getting my nautilus scripts to work correctly.
The problem arises that even with the script in the nautilus script folders, running it in a nautilus action doesn't fill in the file-select variables (
NAUTILUS_SCRIPT_SELECTED_FILE_PATHS) that the script needs to run my program. However running them via scripts menu does. I'd like to know if it's possible for this to work?
This appears when no files have been selected since this will start my program to receive the files. I need to get this to be able get the folder I've right clicked within if possible:
This appears when some files are selected, I need to be able to get the list of ones selected so that my program knows which files to send:
What I have to do currently is use the scripts menu This is undesirable because the scripts menu only appears when an item is selected:
Is what I want to do possible?
Additional information: The program to send/recieve them is a socket server I've written, I am aware I could probably do it much easier with simple bash FTP but I don't my prof would be impressed by a 4 line solution on a term project.
I'm writing the scripts in bash.
Here is an example of the bash code:
#!/bin/bash echo Hello World! IP=$(zenity --entry --text "What is the IP you want?" --entry-text "") PORT=$(zenity --entry --text "What is the PORT you want?" --entry-text "3000") for file in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS do zenity --info --text $file /home/admin/fileSending/clientRecieve $IP $PORT "$file" done echo $IP