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
>
>

Reply via email to