 Recently, I asked you guys if you would prefer me to write a new X-Monad config to use Polybar as a panel rather than X-Mobar. If I switch over to my desktop, this is my standard X-Monad desktop using X-Mobar. X-Mobar had a recent release. They pushed out a new major version that kind of messed up the fonts a little bit. The font rendering they're using now doesn't have any anti-aliasing, so the fonts don't quite look as crisp and as sharp. Honestly, if you pick the right fonts and the right font sizes, it doesn't look too bad. I could actually live with this, but I know some people are a little picky, not to mention some people just like having choice. I told you guys I would actually write a second X-Monad config. I'd maintain two X-Monad configs on my .viles and also as part of the DTOS core repository. I'd have X-Monad with X-Mobar and X-Monad with Polybar. Of course, I don't really have to work on X-Monad with X-Mobar because I've already got it. Here's my config here written, of course, in org mode. It's a literate config. I've titled this X-Monad with X-Mobar.org. It's the name of this document. When I write with a colon W, it actually does a tangle and it tangles it to X-Monad.hs. Let me open up a vertical split here. Let me search for another org document I have. This one is similar, but it's got some differences. This is my X-Monad with Polybar.org. Once again, when I write and quit, it tangles to X-Monad.hs. You can use either one of these configs. Both of them will write to the main X-Monad config file, which is X-Monad.hs. Right now, you can see I'm using X-Mobar. If I come over here to my X-Monad with Polybar config and do a colon W to write, and let me go ahead and force a tangle with space M capital B, now let me restart X-Monad. SuperShift R, and you can see we now have Polybar here at the top. We also still have Trair running. Let me run a kill all Trair. That is the magic of writing these things in org mode using these literate configs and having them tangle right out to the same file, because I could always come back over here to the X-Mobar config and do a colon W space M capital B to run that org babble tangle. Now SuperShift R, watch what happens. It kills Polybar, it reruns my X-Mobar config, so now we get X-Mobar Trair comes back as well. For those of you that are going to use either or both of these configs, let me explain some of the differences. I'm not going to go into great detail, but there's going to be some different imports depending on whether you're using X-Mobar, there's going to be several X-Mobar Haskell libraries that get imported if you're not using X-Mobar, though most of those are not here. So really, there's a few imports that are not here. Other than that, if I go to the bottom of both documents here, you will see that the main block here with the X-Mobar config is quite a bit bigger than the main block with Polybar. And that's because X-Mobar, a lot of the X-Mobar settings were all hooked in to the main block. I had to define all the colors and the wrappings as far as should it be wrapped in brackets, angled brackets, or parentheses, I do a lot of the style stuff with X-Mobar. Of course, all of the widgets over here get styled in the X-Mobar RC, but the main workspace section over here, a lot of that stuff is configured here. With Polybar, obviously, I don't have to include any of that X-Mobar stuff, right? So none of that, none of the Polybar stuff really has to go in this main block here. All I have to do is just make sure Polybar gets auto-started. So if I go to the auto-start section, you can see spawn polybar dash X-monad. So I have a script that's going to be in local bin, it's going to be Polybar dash X-monad. That's just a simple little script that launches Polybar designed to use X-monad. And the reason I'm doing these separate Polybar dash name of window manager is because I may eventually package other window managers that also will launch Polybar, and they'll need a different launch script than what X-monad will require. Now let's talk about some of the differences with Polybar and X-Mobar as far as the look and appearance. Obviously X-Mobar was designed to actually be run with X-monad. So you've got all this functionality in here as far as it tells me exactly. I've got three monitors. The three monitors you see are colored purple, I chose that color, I could color it anything. The one that currently has focus, I've chosen to have it designated with an underline. And then all of the workspaces that are not currently focused on any monitor are blue in color. So these are basically unused. If they had an open window on them, I think I had an asterisk to the side of them. Let me actually demonstrate that. So I'll open something. Let me go back to correction. I didn't have an asterisk next to the workspaces that are not visible, but do have windows on them. I have an overline on them. So that is how that is done. So let's switch back over to Polybar. So let me go to the Polybar config and do a org babble tangles. So it rewrites my Xmonad with Polybar org document back over to xmonad.hs. Do a super shift R to restart Xmonad. Now the bar is going to look a little bit different here. Let me kill all trair again. I should probably just add that to my auto start hook in the scripts here. But you can see I have tried to theme the widgets to look the same. They're all underlined. They're all using the same colors. They're all using doom 1 colors right now. The workspaces are named the same. I had to add workspace numbers in front of the names just for convenience sake. And the reason is, unlike Xmobar, which will always show me the nine workspaces, for whatever reason, I don't know how Polybar is supposed to work, but at least here in Xmonad, it only shows me, I'm on workspace 1 here. This is kind of weird. Am I on workspace 1? Yes, I am. I had to double check because I've restarted Xmonad so many times. Originally, I actually put this on workspace 2, but the restart rearranged some of the workspaces. So I'm on workspace 1. It has focus. Again, I've chosen a pink color to let me know which monitor, which workspace has focus. And then this monitor has something on it. That's why it's underlined in blue. But that is OBS over here on my right monitor. Now all the other workspaces you can see are here. They don't have underlines under them, so they're empty workspaces. These also are workspaces that I'm not currently looking at on any monitor. But there's one workspace that's missing here. Workspace 2. Where is workspace 2? Actually, now that I think about it, where is workspace 3? Workspace 3 is on the far right monitor. You can see if I switch focus. Switch focus over here to workspace 3. Now workspace 1, the middle monitor here, you can see. Now it just tells me that it's workspace 1, which is div, right? It's weird. When I switch focus, the monitors, it is confusing. At least it was very confusing. I've been using this for a few days, and I kind of understand how it works. But I'm not crazy about that. I would like to be able to force it to always show me all nine workspaces and just let me know which ones are on which monitor. And honestly, even if I can't get that functionality, the way it works right now, I'm okay with it. Now let me open my Polybar config. So this will be my polybarconfig.ini. So for those of you that are unfamiliar with Polybar, Polybar is kind of confusing to configure. It's not an easy panel to configure, because it's got a lot of settings and just the format of it can be kind of confusing at first. But you'll get the hang of it, especially if you just go grab somebody else's config. My config here started life. I want to say I got this config originally. Now it's been heavily modified, because I've had it for a number of years and used it with several different window managers. But I want to say it was originally the Arco Linux Polybar config for possibly BSPWM. But again, that was a number of years ago when I first got it. And I've added it quite heavily over the years as well. You've got some settings here, global slash WM. Then you've got settings here. And again, I think these are kind of global settings, but you're going to override a lot of this kind of stuff later. Then you've got some format stuff and you can see the comment. This defines fallback values used by all module formats. But most of the modules, because this will be separated into various modules is how Polybar works. And your modules are going to define a lot of this stuff. So these are just kind of fallback values, really. I didn't play with any of that stuff. And then I've got the section colors. Now your color section here, this is a default module in Polybar, just colors inside brackets. And then you need to define however many colors you want, give them whatever name you want. And for all of my color values, instead of giving them like a hex color value, what I did in the color module here, you can see, I give it a variable. Doom one dot background. And the reason is I created another module called doom one with background foreground and then colors zero through 15. So it's a 16 color scheme, right? So in the main colors module, which really defines the colors used in Polybar, I can just swap doom one for example with Dracula. You can see the Dracula foreground background and then colors one through 15, all I've got to do is just come in here. And if I wanted to, I could do this manually, right? I could just select this block here. I could change that to Dracula. If I write that, the Dracula colors are in Polybar. And if I undo that, right? You can see I'm back to the doom one colors. And what I've done is all of the 10 color schemes that I had been using as part of DTOS, I've defined them here. And of course, I've made this a lot easier than you'd never have to go to your Polybar config to change the color scheme because I've got a script as part of DTOS. It's been a part of DTOS for a while. It's a Super P followed by C. I believe it's a local bin script that is called, I believe, DTOS-color scheme. And you can see I can choose any color I want, for example, Solarized Light. And you can see it changed Polybar colors to Solarized Light. If I do Super P, C again, and I go back to doom one, I get the doom one color scheme back. And of course, that particular script, that DTOS-color scheme script, that doesn't just change Polybar colors. It actually changed the colors in X-Mobar. If you were using X-Mobar, it also changed the colors in the Alacrity Terminal. Let me switch to an empty workspace and show you. Here's the Alacrity Terminal. Also changed the colors in the cocky. So Super P, C, let's switch to the Nord color scheme. You see, Alacrity changed to Nord. Polybar changed to Nord. Cocky changed to Nord. And also Doom Emacs will change to the Nord color scheme, but only after you restart it. Or you could just manually go back into Doom Emacs and do space HT to choose a theme and just search for Nord. And now everything's using the same color scheme there. Now let me zoom in a little bit. If you get past the color section here of the Polybar config, you've got these main bar sections. So you're going to have some kind of launch script. Remember I named a script Polybar-Xmonad? I could have a launch script. I'd name it Polybar-BSPWM or Polybar-I3 or whatever it happens to be. And what they'll do is they'll specifically call upon these modules here, these main bar modules that kind of dictate how your Polybar will look depending on which window manager you're in. So there was one for BSPWM. But if I scroll down, there's going to be one for Xmonad. There was one for I3. There was one for Herb's Luft up there. You can see, main bar Xmonad. And here I just set some settings that are pretty self-explanatory as far as foreground color, background color, some padding, separator. I'm not using a separator, but it would be what kind of separator you want between the modules. And then of course, some of the most important stuff will be the fonts. You can define as many fonts as you want. And then where the real magic happens is modules. So modules left, module center, modules right. So once you get past all the main bar section of the config, if I scroll down, you'll eventually come to this section, Modules A through Z. And you'll have these individual modules, and they'll be prefixed with module slash, name of module. And there are, I don't know, 20, 30 modules, battery modules, memory modules, et cetera. And that's what's actually being displayed up here. So if I do a search for Xmonad, let me find that main bar dash Xmonad here. Scroll back down to the modules left, module center, modules right. Module left is EWMH. So that is what is needed in Xmonad, because Xmonad is a window manager that uses EWMH to display workspace names. So that's important. And then Xwindow, if you want it, fine. If you don't want it, you could delete it. But that's the window with focus. So right now, we're looking at my config.any inside doomimax. If I move over to this workspace, I'm actually focused on a terminal. You can't see it. But you guys see the tilde character being displayed in polybars, because my terminal is in home, which is, of course, alias for tilde. And then modules center. I don't have any centered modules. But if you wanted a centered time and date like you'd have in the GNOME desktop environment in that panel, you could do something centered as well. And then modules right is kernel CPU memory file system, which is the disk space being taken up. Uptime, ArchAUR updates, the number of updates I have currently available, post audio volume, and then date. So those are the modules that I have. And that's really a good introduction to Polybar there. Let me do a super PC one more time to get back to my original doom one colors, because I am going to push all of this to my GitLab here in a minute. And I want to make sure that everything defaults to doom one, especially when I package it for DTOS. For those of you that are interested, if you already have DTOS installed and you want the new Xmone with Polybar, all you need to do is, well, let me zoom in, you need to do a sudo pacman dash DTOS. If I can spell it correctly. DTOS dash Xmone. It's the same package that's always been there if you've been using DTOS. Except now, when you install it, it's going to install my new configs. It installs them to slash etsy slash DTOS. It doesn't override anything in your home directory, so nothing's in use when you install that. What you would have to do is, cd into slash etsy slash DTOS. And then think of this as your home directory, potentially your home directory, so dot config slash Xmone add. I do an LS, you can see. Xmone add with polybar.org, Xmone add with Xmobar.org. And if you're an Emacs user, every time you do a org babble tangle, if working with these files, these are your new configs, it will automatically write to Xmone add.HS. Now, if you're not an Emacs user, then you still just need to edit the Xmone add.HS. So how do you get an Xmone add.HS with Polybar? Or how do you get one with Xmobar? Well, cd one more time into this directory here, Xmone add example configs, so do an LS and that and you can see. Xmone add with polybar.HS, Xmone add with Xmobar.HS. Just copy that into your dot config slash Xmone add directory, rename it to just simply Xmone add.HS because Xmone add demands that that config file be named that. And then of course recompile Xmone add, you guys know how to recompile. Xmone add space dash dash recompile and then super shift R to restart Xmone add. And then once you've got the Xmone add config, then the next package you want to install, you wanna do a sudo pacman dash capital S DTOS dash Polybar, which I just remembered to add the dash capital S. I'll edit that in post, but yeah, to install software with pacman dash capital S and then name a package. So what you need is DTOS dash Polybar and you could do those at the same time, get the latest Xmone add configs and the new package DTOS dash Polybar. If I go ahead and hit enter, I think I've got both of those already installed as the latest, but I'll go ahead and reinstall them anyway. So I've been working on that Polybar config and the two different Xmone add configs as well as the associated scripts like the change color scheme script, the DTOS dash color scheme script, some other things just briefly I'll mention that I've been working on and I don't know when I'll eventually finish this stuff, but I've been working on a website, potentially a website eventually dedicated to DTOS because right now I'm just using my distro.tube site, which is really kind of a site, mainly for the YouTube channel, but I should have a DTOS site separate from distro.tube because right now I've got that over there, but eventually I'll move that to a different site and I want to actually pimp it out a little bit. I actually wrote this using Emacs org mode, it's a static website. I may actually do another video on how to write websites using Emacs org mode because this has actually been fun, kind of writing a new DTOS website. And eventually I need to finish working on some of my like Haskell GTK programs, such as the DTOS welcome application, which I haven't actually taken a look at in months, but eventually I just need to get off my lazy butt and finish some of this stuff. Now, before I go, let me thank a few special people I need to thank the producers of this episode, Gabe James Maxim, Matt Mimic, Mitchell Paul, Royal West, Armored Dragon, Bash Potato Chuck, Commander, Angry George, Lee Methos, Nate Erion, Paul Peace, Archimdor, Polytech Realities, for Less Red Profit, Roland Tools, Devler and Willie, these guys, they're my highest tier patrons over on Patreon without these guys. This episode would not have been possible. The show is also brought to you by all of these ladies and gentlemen, all of these fine ladies and gentlemen that help support my work over on Patreon without each and every one of these guys. I couldn't do what I do. I don't have any corporate sponsors. I'm sponsored by the community. If you like my work, subscribe to DistroTube over on Patreon. All right, guys, peace. Seeming Polybar is fun. Maybe I should go back to BSPWM for a little while.