 Hey guys, welcome back to my YouTube channel. This is Daniel Rosely here for today's video. It's going to be a quick one regarding how to set up a very simple key binding in order to be able to put your Linux computer into a suspend state using only one key. Suspend is very, very useful. Unlike turning off your computer, it's going to save what's on your screen or screens and you can boot out of it or get out of it by just typically moving your mouse or keyboard. It uses a fraction of the electricity that you would use if the computer is running. So if you're away from your computer for a few hours and you want to keep everything in place, suspend is really useful. So two parts to this tutorial is not going to be super complicated. First package you're going to need is something called power management utils. So the command here, I'm not going to actually run it because it's installed on my computer. Pseudo apt get install and it's p m hyphen ut and if you don't already know this, you can use the tab function on Ubuntu to fill in packages. So p m ut i l s utils is short for utility and then install that. So as you can see, I'm already running the newest version of this package, which is one decimal four, decimal one hyphen 19. That's part one is installing this package. The second part is creating a key binding. Now I am using LXDE. This is actually a pretty new installed of this computer. And I've just bookmarked the dot config folder. It's at home. Your username for slash dot config. And this is where you're going to find the configuration files for a lot of stuff on your desktop. Now if you jump down here to Oh, just after OBS, I have open box. And within that folder, there is a single file. It's called LXDE hyphen RC decimal XML. So I'm going to open this in a really, really simple code editor. I'm actually just going to use mouse pad for this example here today. And you're going to see the key bindings on open box. Now I add a couple and just to skip through this document a bit, I'm just going to search for the keyword custom until I get to this. So this is my custom key bindings. The key bindings, I'm just highlighting here in blue on my screen. And the one for executing the command is grab. Now there's a little command you can use called XEV. I'm just going to jump into it from a new tab here, XEX, very echo Victor and XEV is a little utility that you can type in a key I'm currently pressing S. And you're going to find details about its key code, right? So if you're not sure what a how to look up the key code for a particular key on your keyboard, you can just type into this little box. And it's going to give that to you. So I'm going to go ahead and just close it down now. So grab is what I personally use, but you might find another key you can see I'm also using sorry, I'm actually using scroll lock for suspend, I'm using grab for X screensaver. So key bind, key bind, key equals, and then you have the key name, action name equals execute. And this is where you can, you can assign a terminal command to pressing that key. It just needs to be buffered in by command and end command. And it's simply sudo PM suspend, PM suspend is one of the calls you get when you install the PM utils package. So now all I need to do on this desktop computer is type is hit the scroll lock key, and it's going to get me into suspend. Clearly, if you use scroll lock on a regular basis, you're not going to want to assign it as a key binding, because this is actually going to overwrite the shortcuts on any program you have on your desktop. Perhaps there is another key, perhaps you have a macro keyboard, and you've got a few keys spare for these key binding. So just do something that you're not going to require in any program that you're using. I've traditionally used scroll lock for suspend and it works great. So I just need to press suspend, sorry, scroll lock, and it suspends the computer. And then I just when I'm back on my computer, I just move the mouse or press a key, and it brings it straight back up. Hope that you that how to video on getting a custom key binding for suspending your Linux computer was useful. If you want to get more videos about Linux technology and other subjects, then please consider subscribing to this YouTube channel. Thank you very much for watching.