 One of my favorite things about using a tiling window manager is that it kind of forces you to get into the mentality of using your keyboard more often and I've really enjoyed coming to learn how to use my keyboard in my workflow To be more productive and I highly recommend for anybody who's interested in being more productive to try a keyboard-centric workflow It's definitely not for everybody. It definitely takes time and effort, but I think in the end. It's probably worth it for most people One of the things that I've discovered in the last couple months though is something called a key cord now a key cord is a specialized key binding that allows you to combine different key presses in different ways in order to run commands or open up applications and Honestly, these things are great. Now. These aren't new by any chance. They're new to me Which is why I'm making this video, but they've been around for a long time if you've been using emacs You've been using them forever and if you use something like xmone add or q-tile. These are actually within your Tiling window manager already all you would have to go through and do is add them to your configuration file But if you're using a window manager that doesn't have these built in there is a way you can actually use them And that's by using sxhkd now if you don't know what sxhkd is basically it's a Hotkey demon, which is part of the name actually that allows you to use it to set key bindings And as long as it's running in the background the system will actually recognize those key bindings now As sxhkd was actually developed for the BSPWM window manager But a lot of people use it for other window managers as well, and I'm one of those people I use it for DWM. I use it for BSPWM. Obviously. I've also used it a little bit in Q-tile, I've used it a little bit in like Spectre WM I enjoy using it because it allows me to take the more generic key bindings the things that have nothing to do with the window manager And allows me to transfer those key bindings across window managers So I don't actually have to go through and take my see my browser key binding and put it in every single configuration file That would be a pan the ass so today what I'm going to do is talk about how you can use sxhkd to Actually use key cords within whatever window manager you're using. So let's go ahead and jump in Now this is my DWM setup and there's nothing really all especially about it is just DWM But DWM doesn't actually support out of the box key cords So in order to do that we have to use sxhkd So the first thing you have to do is actually install sxhkd. In order to do that you just do sudo pacman dash s sxhkd if you're on an art system Or if you're on Ubuntu sudo apt install sxhkd, okay So I already have this installed, but I'd be using the pacman one, but if you're on a Debian-based distro you'd use apt So once you have it installed you have to ensure that it's running so you can do this in however you manage your auto start file I do this with an auto start patch for DWM So if I do go into my DWM folder here and I have an auto start script So I can just do vim auto start and then I have this line right Here for sxhkd and basically every time DWM starts I start sxhkd And then I have multiple instances of sxhkd rcmi system So I have one specific for DWM And that's why I use this C flag in order to actually point towards a specific configuration file You probably don't need that just use exit sxhkd in which case You'll need a configuration file which would be then located in dot config slash sxhkd Slash xx sxhkd rc mine is actually in that DWM file sxhkd rc ss I'm gonna say this word until I actually get without missing up sxhkd It desperately needs a better name. So if we do an all us here We have the rc file here, and I can just do them vim and sxhkd rc, and then this is what that looks like I'm not going to go into all the functionality of sxhkd Specifically, we're gonna be looking at key chords today. They're really actually pretty simple the syntax actually for a key chord looks Exactly like this. You have the key binding You want to bind to so in this case super g and then you have the key that you actually want to go through and press that would associate to the program you want to launch so in this case and Tnl associated nitrogen telegram and LibreOfficeRider, so if I do super g plus l I would get LibreOffice open That's really really cool and The benefit of this is that it'll it gives you more options for Launching stuff so that you don't have to take up your modifier keys because a lot of time you modify key fire keys like control Are for other things like you couldn't use control z for something like that because that's you know That's a that's a paster copy commander, whatever same thing for like control alt and whatever those things are often used by your Window manager for other things So if you are able to do something with a key binding that's not used and then use that for multiple different things That's great and it allows you to free up your modified key is that control alt and super for things that are more Appropriate for your window manager like moving things around and all that kind of thing So what would you do if you wanted to go through and actually create your own key cord in order to do that? all you'd have to do is go through and Choose a key binding that you don't use so in this case we're going to do alt plus T and then you'd use a semicolon and Then you'd want to do the key or number or or letter or whatever you wanted to associate with the program You're going to be launching so in this case I'm going to use H and then we'll do a space and do a couple put a couple spaces here And then what we want to do is put in the command that we want to run in this case I wanted to run say H top so in order to do that I have to tell it to do a Lackard II dash e H top okay, and then if I save this and Restart my SxHK DRC file using super escape. I can do alt T plus H and I get H top that is how you create key cords in SxHKD now like I said you have to make sure that this is running the background so it has to go in your auto start file I showed you how it I did that in mind, but if you use a different window manager other than mine Or other than DWM it may be done a little bit differently. So you'll have to look that up on your own Like something for I3 that you're you could start SxHKD directly from the I3 configuration file If you're using something like BSPWM, that's just could be started directly from the the BSPWM configuration file Same thing with the X-Moon it actually all those things all those happen to control the auto start stuff directly from Their configuration file. So you do just go through and start SxHKD from there There is a default SxHKDRC file on your system. You can find that in the Documentation for SxHKD, which I'll link to in the video description. So that is it for this video You can follow me on Twitter at Linuxcast You can support me on patreon at patreon.com slash linuxcast Before I go I'd like to take a moment to thank our current patrons Devon Marcus, Maiklin, Donnie Sven, East Coast Web Merrick Campimichael. Thanks everybody for watching. I'll see you next time