请问zenity --password在脚本里怎么用
发表于 : 2021-03-04 14:09
我想在thunar右键菜单里加一个改变文件权限的按钮 想用zenity来输入密码 不知道脚本里该怎么写
代码: 全选
-A, --askpass
Normally, if sudo requires a password, it will read it from
the user's terminal. If the -A (askpass) option is speci‐
fied, a (possibly graphical) helper program is executed to
read the user's password and output the password to the stan‐
dard output. If the SUDO_ASKPASS environment variable is
set, it specifies the path to the helper program. Otherwise,
if sudo.conf(5) contains a line specifying the askpass pro‐
gram, that value will be used. For example:
# Path to askpass helper program
Path askpass /usr/X11R6/bin/ssh-askpass
If no askpass program is available, sudo will exit with an
error.
代码: 全选
-S, --stdin
Write the prompt to the standard error and read the password
from the standard input instead of using the terminal device.
代码: 全选
zenity --password | sudo -S XXX