I have this very simple script :
Code: Select all
#!/bin/sh
gpg -d $1 >${1%.*}
Another question : Where must I put a caja script so that it can be used by any user ?
thks
Code: Select all
#!/bin/sh
gpg -d $1 >${1%.*}
Code: Select all
#!/bin/sh
FILE=$(echo "$CAJA_SCRIPT_SELECTED_FILE_PATHS")
eiciel "$FILE"
exit
Sorry, but when I click F1 (or the menu) in caja, it just opens this web page. I don't see anything about caja in the Mate PDF...eanfrid wrote:4/ use is explained in caja help about scripts
Ok. So, you are obliged to have a link for each user... I thought that there was a way as for Nautilus : you can put also Nautilus scripts in /usr/share/nautilus-script...eanfrid wrote:5/ my method for system-wide scripts is to store them into a folder under /usr/local/bin/caja_scripts and make a symlink to them in ~/.config/caja/scripts
Code: Select all
#!/bin/sh
FILE=$(echo "$CAJA_SCRIPT_SELECTED_FILE_PATHS")
gpg -d $FILE >${FILE%.*}
jibe wrote:It's working well in a terminal or a console, but when I use it as a caja script, it gives me an empty file !
Based on what's being described in this thread, two things came to mind:jibe wrote:gpg is asking me the passphrase the first time I use it, and never after until I close my session and open a new one.
Code: Select all
#!/bin/bash
## Décodage d'un fichier chiffré
# if this script was not launched from a terminal, restart it from a terminal
if [[ ! -t 0 && -x /usr/bin/x-terminal-emulator ]]; then
# /usr/bin/x-terminal-emulator -e "bash -c \"$0 $*; read -s -p 'Press enter to continue...'\""
/usr/bin/x-terminal-emulator -e "bash -c \"$0 $*\""
exit
fi
FILE=$(echo "$CAJA_SCRIPT_SELECTED_FILE_PATHS")
gpg -d $FILE >${FILE%.*}
#rm -f $nomgpg
TBH, I didn't know it's going to open a graphical dialog box. I based my educated guesses on what I read so far (or maybe I missed something LOL). From past experiences, CLI tools and commands normally don't present dialog boxes when they need you to input something. An example is sudo vs. gksudo. gksudo displays a graphical dialog box while sudo simply prompts you in an open terminal window.jibe wrote:It's a little surprising ... When it asks for the passphrase, it opens a GUI box.
If I consider what I see in Synaptics, it seems that I have all for Mate, including yelp. But I'm using Maya, and the Mate version is 1.2. Probably it's the explanation...eanfrid wrote:I am using MATE 1.8:
Edit1: maybe your installation of MATE is not complete (for instance, "yelp" must be installed)
Ok, thanks : I'll have a look. But I like also to have scripts : this one was just to try, in fact I want to launch directly the right application as if the file was not encrypted. Example : decrypt the file, open it in pluma, and re-encrypt.eanfrid wrote:Edit2: I use "gpa" for encryption/decryption and key management with a GUI
Yes. gpg is a little different, as it does open a graphic box (like gksudo), but also allows you to type the passphrase in the terminal (lke sudo) ! The two in the same time : If you just cancel the GUI box, you'll be still able to type your passphrase in the terminal. But if you give it in the GUI box, it will stop to wait for your answer in the terminal and decrypt he file.Pilosopong Tasyo wrote:TBH, I didn't know it's going to open a graphical dialog box. I based my educated guesses on what I read so far (or maybe I missed something LOL). From past experiences, CLI tools and commands normally don't present dialog boxes when they need you to input something. An example is sudo vs. gksudo. gksudo displays a graphical dialog box while sudo simply prompts you in an open terminal window.
Ok, no problem : I'll open a new topic for that.Pilosopong Tasyo wrote:As for your other questions, I'm afraid I cannot answer them. I never used gpg before, so I can't provide accurate answers.
To make sure: of course you must also have installed mate-user-guide, did you ?jibe wrote:Hi,
If I consider what I see in Synaptics, it seems that I have all for Mate, including yelp. But I'm using Maya, and the Mate version is 1.2. Probably it's the explanation...eanfrid wrote:I am using MATE 1.8:
Edit1: maybe your installation of MATE is not complete (for instance, "yelp" must be installed)