Suspend via keyboard shortcut fails

I am trying to map a keyboard shortcut to put my computer to sleep.

1c1107db0946e9d36bfc8dcc0983e953a5422734.png

I have successfully enabled my user to run the command without prompt.

and when I run

sudo systemctl suspend

via terminal it works perfectly.

However, when I run my new keyboard shortcut, it works perfectly and goes to sleep for 1 second before immediately resuming.

Any advice?

Well that was simple. Fix was there was already a built in keyboard shortcut for sleep so I didn’t even have to use the terminal command.

1 Like

I’m using Fedora 37 with X11 and I could not get it done. So I created shortcut using systemctl suspend -i while pressing crtl + del, it worked great.

1 Like

Marcos solution works like a charm :point_up_2:

1 Like