我正在使用LinuxMint 18与肉桂,并试图加密一个文件使用自定义命令,从右击菜单。
我认识nemo-actions。
sample.nemo-action复制为encrypt.nemo-action并对其进行编辑。encrypt.sh的脚本,并将命令放入其中~/.local/share/nemo/actionsnemo -q (或killall nemo),然后使用nemo重新启动nemo,以查看我的选项。这是我的档案。
encrypt.nemo_action含量
[Nemo Action]
Active=true
Name=Encrypt "%N"
Comment=Encrypt the file with a passphrase
Exec=<encrypt.sh "%F">
Icon-Name=folder
Selection=s
Extensions=any;
Quote=double
EscapeSpaces=trueencrypt.sh含量
#!/bin/bash
zenity --password | gpg --passphrase-fd 0 --output "$1.gpg" --symmetric "$1"
zenity --info --text="$1.gpg"现在,问题是,当我在终端中运行这个脚本时,它完美地完成了它的工作。但是当我从右键菜单运行它时,会出现zenity提示符,输入密码,然后出现info对话框,但是没有输出文件。为什么?我做错了什么?
注:是的,我知道seahorse。
发布于 2019-04-29 09:39:51
此操作可以在没有文件"sh“的情况下工作。
Active=true
Name=Encrypt gpg
Comment=Encrypt the file with a passphrase
Exec=gpg "%F"
Icon-Name=gpg
Selection=s
Extensions=gpg;
Quote=double
EscapeSpaces=true或者,您可以创建脚本并在默认情况下使用此脚本打开所有文件*.gpg:
#!/bin/bash
fullpathname="$1"
path="${fullpathname%/*}"
cd $path
gpg --yes --use-embedded-filename "$fullpathname"https://stackoverflow.com/questions/42024523
复制相似问题