Hi Luis, i confirm, i use that with several scripts add yourself to group sudo if not already, then edit /etc/sudoers with command visudo (alone, no args) in root :
add a comand alias : Cmnd_Alias SUSP = /usr/sbin/pm-suspend then add this rule : %sudo ALL=NOPASSWD: SUSP That's all Le 13 nov. 2012 - 12:40, message de David Dawson : > Hi Luis, > > I think you can change whether or not you need the password in your > /etc/sudoers file. > > Depending on your OS, there might be a section that says something like: > > ## Allows people in group wheel to run all commands > # %wheel ALL=(ALL) ALL > > ## Same thing without a password > # %wheel ALL=(ALL) NOPASSWD: ALL > > > I suspect what you'd need is to give some rules that say you don't need a > password (NOPASSWD) for pm-suspend. I'm not sure if this is correct for > all distros, and I haven't tried this myself. > > > Dave > > > On Tue, Nov 13, 2012 at 11:51 AM, Luis Ramirez <[email protected]>wrote: > > > Hello all, > > > > I am trying to run a command with elevated privileges from the > > rc.lua. More specifically, I am trying to get my laptop to go into sleep > > mode when I hit mod+shift+'s'. Here is the code snippet from my rc.lua. > > > > --sleep mode > > awful.key({modkey, "Shift" }, "s", awful.util.spawn_with_shell("sudo > > pm-suspend")), > > > > > > However, when I hit the keys, nothing happens. I suspect that this happens > > because the of the sudo preceding pm-suspend. Does anyone have any > > suggestions as to what i should do? > > > > Thank You, > > > > Luis Ramirez > > > > -- Pierre FUMET -- To unsubscribe, send mail to [email protected].
