0

I had some problems with my Thinkpad X200T not suspending under 14.04 LTS, after trying different solutions, it seems the easiest fix is to just execute

sudo pm-suspend

How would I go about making this the default action when suspending? (mapping System Menu -> Suspend and my FN+F4 button (the one with the moon icon :) )?

1 Answer 1

1

While I don' t know much about remapping keys, I suggest a workaround by binding pm-suspend to a keyboard shortcut. Make pm-suspend executable without password by placing something like %yourusername ALL = NOPASSWD: /usr/sbin/pm-suspend into your /etc/sudoers file and then bind gksu pm-suspend to a shortcut in System Preferences -> keyboard -> Shortcuts -> Custom

3
  • Hm, this could be used as a workaround. So far I managed to get it to execute 'sudo pm-suspend' without asking for a password ( 'gksu' was not installed, but even upon installing it it was still asking for a password). The problem now is that keyboard shortcuts do not seem to work. I tried System Preferences -> keyboard -> Shortcuts -> Custom, but that didn't work at all, so now I am attempting to use CompizConfig Settings Manager to set the shortcut, still no luck...
    – Michael
    May 13, 2015 at 20:13
  • Interesting. Running gksu pm-suspend in terminal never prompts me for a password (with pm-suspend already set to NOPASSWD in sudoers). How about making the shortcut /bin/sh -c "sudo pm-suspend" ? May 13, 2015 at 20:18
  • My apologies, it seems that my terminal simply cached the escelated privileges of the 'sudo visudo' command, while in fact 'sudo pm-suspend' still required authentication (it just didn't ask due to me typing in my password already for the visodo bit. Anyways, turns out that my sudoers file was somehow wrong (for anyone else that finds this, your NOPASSWD entries must be the last entries in the sudoers file I think). After correcting my sudoers file the '/bin/sh -c "sudo pm-suspend" ' comamnd magically worked, even as a keyboard shortcut from ccsm. Thank you very much!
    – Michael
    May 13, 2015 at 20:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .