没地方输入密码 compiz Keybindings

各种窗口管理器和美化相关
回复
ousunred
帖子: 199
注册时间: 2007-02-06 22:45

没地方输入密码 compiz Keybindings

#1

帖子 ousunred » 2008-10-06 0:39

在compizconfig 里输入一关机command line 0 : sudo shutdown -h now

再设有相应的键,,可是并没有关机,,想想是没输入密码,,有没有什么办法让compizconfig自动输入密码?

命令里是不是要修改修改 加点什么 比如dos里有 < 这样的定向功能符
头像
HuntXu
帖子: 5776
注册时间: 2007-09-29 3:09

Re: 没地方输入密码 compiz Keybindings

#2

帖子 HuntXu » 2008-10-06 0:40

gksu...
HUNT Unfortunately No Talent...
ousunred
帖子: 199
注册时间: 2007-02-06 22:45

Re: 没地方输入密码 compiz Keybindings

#3

帖子 ousunred » 2008-10-07 12:42

没人这样知道吗?
doitian
帖子: 3
注册时间: 2008-11-08 19:52

Re: 没地方输入密码 compiz Keybindings

#4

帖子 doitian » 2008-11-08 20:03

2楼的方法是可行的,因为你在X环境下执行sudo没有输入绑定,是没办法输入密码,而gksu和sudo功能相同,唯一不同的是它弹出个对话框让你输密码。如果想要按键就直接关机的话可以在sudoers里设置,用sudo执行shutdown命令的时候不需要密码:

打开终端

$ sudo visudo

用visudo编辑sudoers file

在打开的编辑器(黓认是vi)里添加以下行:

Cmnd_Alias SHUTDOWN_CMDS = /sbin/shutdown, /sbin/reboot, /sbin/halt
your_user_name localhost= NOPASSWD: SHUTDOWN_CMDS

your_user_name换成你使用的用户,然后保存。
详细格式参考这里:https://help.ubuntu.com/community/Sudoers
doitian
帖子: 3
注册时间: 2008-11-08 19:52

Re: 没地方输入密码 compiz Keybindings

#5

帖子 doitian » 2009-05-28 14:14

如果启动了gnome-power-manager
也可以用

gnome-power-cmd shutdown
回复