 You guys have heard the old joke that Emacs is more than a text editor. It's really a desktop environment and That is entirely true if you wanted to you could use Emacs as your window manager where when you start X or you log in from your login manager such It's like DM you can log directly into Emacs and use Emacs as a window manager I'm gonna show you how to do that today. So let me switch over to my desktop here and this is a virtual machine This is Arco Linux with X Monad as the window manager. I just happened to have the Arco Linux X Monad ISO on hand So I quickly spun up this virtual machine for this demonstration today And the first thing you want to do of course if you don't have Emacs installed on your system You want to install Emacs so on Arch or any Arch base system? Of course, you would want a pseudo Pac-Man dash capital S Emacs now I have already got Emacs installed here So I don't really need to run through the installation again and for those of you that are trying to install maybe a Distribution of Emacs something preconfigured something. That's not just vanilla GNU Emacs Go ahead and run through that as well And if I wanted to I could quickly bring up D menu here and let me launch Firefox You guys know that I run Doom Emacs So what I'm going to do is I'm going to do a quick search for Doom Emacs Because if you're brand new to Emacs and don't want to spend months configuring it You probably want to try out a distribution of Emacs like Doom Emacs or Space Max or something like that and to install Doom Emacs You need to put two lines in the terminal You need to run that get clone and then once that get clone is done You need to run the install command right there if I copied that line the get clone here It won't work for me because I've already done it But after that what you need to do is run that command there to install it. I'm not going to reinstall I've already got Doom Emacs on the system and once you have it installed What you need to do is you need to actually launch Emacs So let me go ahead and type Emacs here in the terminal I'm going to launch my Doom Emacs here and if you type alt X meta X on the keyboard inside Emacs you can run a command and the command we want to run is package install run package install and then it's going to ask You what package do you want to install exwm which it stands for the emacs ex window manager and do a search for that I've already installed it here So it's not going to be in the list, but you guys will see just exwm by itself somewhere in the list Just hit enter on that and it will pull it down and install it And then once you have that installed What you need to do is go ahead and quit out of Emacs and if you install Doom Emacs You need to do a sync and how you do that is run the command Dot Emacs dot D slash bin slash Doom because that's the path to the Doom Emacs binary and then a space and then the word sync hit enter It resinks Doom Emacs and then we need to get into the config file for Doom Emacs and The configs for Doom Emacs your personal configs live at Dot Doom dot D that particular directory CD into that if I do an LS There are three files in there config dot L the knit dot L and packages dot L And the one we want to play with is config dot L So I am going to edit it and Vim has already installed by default on Arco So I'm just going to use Vim here even though I've got Doom Emacs on the system I know it's scandalous, right? And this is the default standard Doom Emacs configuration The only thing I have done to this particular Doom Emacs is I have went ahead and added the necessary lines to enable EXWM and it's these lines right here I added that the first thing you want to do is you want to require EXWM so when you launch emacs or in this case Doom Emacs It should require EXWM, which is the Emacs X window manager It basically makes emacs possible to be your window manager You'd also need to require EXWM dash config and you need to require EXWM dash R and R render And of course that's for setting a proper resolution or on various monitors Then what you want to do is you want to set the X render settings So you see set Q EXWM dash Render dash workspace dash output dash P list and then zero That is monitor one zero and then you need to put the name of that particular display And how you would get that is if you open a terminal and do an X render So if I run that here in this virtual machine, you see I only have one display screen zero and That is called virtual dash one So zero and virtual dash one now on a multi monitor system I'm going to have a lot more stuff you guys know that I have a triple monitor system So my line for this actually looks like the one I've commented out above zero Monitor one is actually for me display port dash zero one, which is monitor two for me is display port dash one And two which is monitor three of course for me is HDMI dash a dash zero again You just do an X render you get all this information This isn't something you really have to look up or anything You just run a quick X render and all of this is right there for you now the next line basically sets the Resolution so an ad hook EXWM dash render screen change hook Start process shell command and then you have this line here And that is saying X render dash dash output virtual dash one So that is the display on screen zero and dash dash mode 1920 by 1080 is telling it set it to 1920 by 1080 screen resolution the position it should be zero X zero That is your X and Y coordinates and then rotate normal is if you needed to rotate You know change from a Landscape or something like that you could do that with this X render command and of course this line It's just for me here in the virtual machine where I'm only using one monitor in a VM But on my triple monitor main production machine This command is quite a bit longer because I have to basically define three Displays here and X render so I have X render dash dash output display port zero again And then set the settings for that display port one and then the settings for that and then HDMI dash a dash zero And then the settings for that I know that sounds complicated But again, if you just run an X render in the terminal, you'll get all of this information and that is really all you need That's the only complicated part is Getting your displays if you're on a multi monitor system that may may be a little tricky after that I added EXWM dash render dash enable again because you know of setting the screen resolutions and everything require EXWM dash system tray that enables us to have a system tray in the emacs mode line If we need a system tray and then of the last line I've added EXWM dash system tray dash enable right and quit out of that because we have changed the doom emacs Config what you need to do is once again You need to run the doom sync command and I wasn't in the home directory when I ran that command Let me get back in the home directory There we go and that is it emacs now will act as a window manager when we log directly into it So let me create an X session because how are we going to get into emacs? Well, if you use LightDM or any other login manager You probably want the EXWM window manager to appear in your list in LightDM So, you know if you have GNOME or Plasma or Exmonet or i3 or whatever in that drop-down list now We want emacs to be a part of that drop-down list So let me clear the screen here and what we need to do is create this new file You want to run in the terminal sudo vm and then this path slash user slash share slash X sessions And then I named it emacs dot desktop run that and of course you got to give it root privileges and Of course, this will be an empty document. I've already filled this out. I did a desktop entry name equals emacs Wm exwm or whatever it is you want to name it you could just name it emacs The name is up to you comment is emacs window manager and what does it do it executes this command execute emacs? That's all we wanted to do. That's all this window manager does when we log in it just runs emacs and type equals application So write that and quit and then quit out of whatever desktop environment or window manager You're currently running. So let me get out of X mode ad here and Now when you go back to your login manager like DM in my case You will now have emacs or exwm or whatever you named it as an option. Let me log in and What are we logging into? We're logging into emacs now the screen resolutions acting up here in this VM. So let me fix that So let me restart exwm because a restart. I think we'll fix the resolution and give it just a second So this again is the screen resolution being a little wonky is a VM problem But if I do an alt X here and I do dear Ed And that is the file manager that's built into emacs and let's go ahead and get back into our doom dot D Directory here, and then I'm going to go to config dot el and enter and again We're back into that. This is our window manager now You see emacs is full screen on this one monitor because we're really on a one monitor system here in this VM I could have configured it to be a multi monitor system, but one monitor emacs is our window manager and What is there to learn from here? There's really not too much. I mean you can configure it I mean, you there's some configuration options with exwm But honestly when emacs is your window manager if you've learned how to use emacs you've customized your own personal emacs then There's there's really nothing to learn here if I wanted to I mean I could get in here and I could do a split and then if I did a Think it's super s and then seven on the keyboard So it's really a super and the amper sign and then I get a prompt down here You see the little dollar sign. It's almost like a shell prompt and I can go ahead and launch firefox and when I hit enter Firefox loads in that split here in emacs it loads inside a emacs buffer and That is what exwm that particular plug-in for emacs does it allows all these things that are not Really part of emacs to actually launch inside of emacs inside a frame in emacs Now there are workspaces inside Exwm if I did super to I'm on the second workspace Which is just an empty scratch pad inside do me max super three takes me to the third workspace Super one I think takes me back to the first workspace or super zero takes me all the way back to the first workspace There's four workspaces by default zero three three zero being of course the first workspace You can of course configure this to your heart's content I haven't bothered because I just wanted to show you guys how to get exwm installed because it doesn't really make much sense for me To spend time configuring this and then you know showing you at least not for a beginner video because everybody's going to configure Their own emacs their own way it is important to notice that there is a default exwm config Located somewhere on the system and I that was one of the lines that I added When I added those ten lines or so to make emacs a window manager one of them is exwm Dash config dash default that's basically saying load the default config for exwm I did a meta ex of course I can run all my emacs commands if I wanted to see what was available as far as exwm commands I just type exwm it gives me exwm a knit exwm exit exwm mode Exwm etc. You know changing workspaces deleting workspaces swapping workspaces tells you how to do all that of course you can set keyboard Keybindings for doing all of this the most important command though If you're completely new to emacs when you get into this if you're wondering how to get out of emacs Control X control C is the default command to exit emacs. Well, if I do control X control C It's gonna ask me do I really want to quit emacs I'm gonna type Y for yes, and when I do that gonna kill emacs, of course And gets us back to the login manager because emacs was our window manager So if you kill it, you know, it's gonna boot you back into light DM. So let me log back in That's all I wanted to show you guys here today on this very quick video It's just how to set up emacs as a window manager All you need to do is once you have emacs installed and configured to your liking install the exwm Plugin create a desktop X session for exwm log out log in to exwm pretty simple Now what are the advantages or disadvantages of using emacs as a window manager? Well, surprisingly Not much because if you're already an emacs user and that's the caveat here If you're already an emacs user and you spent all your time in emacs anyway exwm is going to be very comfortable for you because Really doesn't change anything if you are already pretty much living in emacs. It's the same commands It's the same program. You're already using all the time anyway. It's just a more submersive kind of emacs experience because all you get basically is emacs everything is emacs everything you launch is in an emacs buffer And it's dead simple to learn because if you've already learned emacs, there's nothing extra to learn It's a lot different from learning something like stump WM I mean that particular window manager that's kind of emacs like and you know I took a look at it on the channel and man, I struggled with that I spent hours trying to figure that thing out. I don't have to figure this out I don't this is just emacs now. Will I personally try to use exwm as my window manager Am I gonna switch to emacs as my window manager? I don't know. I may spend some time in it I doubt that long term. I'm gonna, you know, become a exwm user You know like for life or anything like that besides I hop window managers all the time anyway I never stay on anything that long but for somebody like me I don't know if it would make sense for me to try to live all the time in emacs You know for all the recording and everything I do live streaming on YouTube and you know How would things like OBS and Caden live and you know all the programs that I use on a regular basis How would they operate in a emacs buffer? Maybe they would be just fine, but I don't know I'm gonna try it out for a little while though. I'm definitely gonna give it a go long term though I think I would probably prefer a proper window manager Especially a proper tiling window manager like you know cutile and x-mone ad and awesome and things like that But those of you that have been using Emacs exwm as your window manager. I would love to hear from you in the comments What are some of the things that you suggest that I add to my config? I haven't really configured mine in any way matter of fact Why don't you guys those of you that have been long time exwm users? Why don't you guys post your configs in the comments? You know post it if you got your config saved on github or get lab or something Why don't you share it in the comments for all of us to take a look at your configs? If you don't have it posted on something like github or get lab just paste your config Over at pastebin and link to that I think that would be really interesting and I think it would be very educational now before I go I need to thank a few special people. I need to thank Michael Gabe haplon a Corbinian Mitchell entropy UK arch 5530 Chris Chuck DJ Donnie Dylan George. I'm repulsion to bias and Willie these guys They are the producers of this episode without these guys You wouldn't know about emacs as a window manager. You wouldn't know about it The show is also brought to you by each and every one of these ladies and gentlemen all of these names are seeing on the screen right now These are all my supporters over on patreon because this show is sponsored by you guys the community You'd like to support my work consider doing so you'll find distro tube over on patreon. All right guys peace