 So I've done several videos about the Xmoned Tiling Window Manager, it's one of my favorite Tiling Window Managers, I've been an Xmoned user for probably a decade now, and a lot of you guys are asking me about the XMobar panel, which is typically the panel that most Xmoned users use, and a lot of you guys are trying out Xmoned and you're struggling getting XMobar configured to your liking. So today I wanted to take a few minutes and show you guys how to configure XMobar and you know how to make XMobar work for you. I think the first thing you guys need to do is you need to do a search for XMobar in your favorite search engine, whether that be something like Google or DuckDuckGo or whatever it happens to be, and chances are you're going to come to this page about XMobar over at Haskell.org, this is the Hackage Subdomain on Haskell.org, it's basically your XMobar man page if you will. This is a rather lengthy document, you know there's a lot to it, but it really does explain everything that you can do with XMobar, and I'm going to link to this page in the show description, and a lot of what I talk about today with XMobar, but really with any tiling window manager, with configuring any kind of panel, configuring your shell, your terminal emulator, a lot of the kind of stuff I do on the channel Veeam, Emacs, you know all of this stuff that you guys want to do. If you just read the documentation, you know most of it is obvious if you just pull up a simple man page for the most part. Now there's some things, sometimes you want to do weird things that you really have to dive deep in the documentation to find, or sometimes the documentation for certain things is not good and you have to ask questions, but 99% of the time if you simply pull up a man page you will find exactly what it is you're looking for, and to be fair XMobar has a fantastic man page, and if we read a little bit of this man page about XMobar, you get to some of the flags as far as compiling XMobar, for those of you that are going to compile XMobar yourself, there's several flags you could give it so that you can compile it with certain modules already enabled. Honestly, if I'm compiling it myself, I'm probably just going to do this all extensions flag to make sure that everything that is possible will actually work in XMobar. Those of you that are just getting a prebuilt binary of XMobar from your Linux distributions package manager, for example, like installing XMobar with Pacman and Arch Linux, XMobar is already built with all the modules available. So you don't have to worry about this. This is just strictly for those of you that are real nerds that are going to build XMobar from source yourself, you need to know a little bit about the flags when you're building it. Now, I could go through this man page and describe to you each and every little thing in here, but I'm going to let you guys read the man page. What I'm going to do is actually pull up my configuration and show you some of this stuff in action. Now, I think what I want to do now is go ahead and switch over to my desktop and let's open up our Xmonad config because we're going to need to edit the Xmonad config. We also are going to need our XMobar config so we can edit that. So I'm going to go ahead and open my configs and do me max. I'm going to open up my Xmonad config and let me toggle on big font mode. So you guys can, you can see everything. So this is my Xmonad config. I'm going to open up a second instance of do me max because I'm also going to open up my XMobar config. I actually have three separate XMobar configs on my system because I have three different Xmonad configs for each of my three monitors because each of them have different widgets on their XMobars. So very briefly, I'm going to run down everything that is in this XMobar config. A lot of it is standard stuff. Some of it is not so standard. The very first thing you need to know is typically you're going to have the word config and then a opening squirrely braces there. You're going to have the closing one at the very end and everything in between those braces is actually your XMobar config. The first thing you need to do is define a font and all of this again is in the man page for XMobar. But first thing is font and typically you're going to go. Actually, if you read the man page here, if I do a search for example config somewhere should be a quick start. And here on the web, there is an example config for your XMobar and it's going to look something like this. You're going to have font equals miscellaneous, fixed font, whatever. I would just grab this. It's a very simple config file. There's not much to it. And the reason there's not much to it is they want you to actually read the man page and pick and choose the modules you want. So there's not much to the default config. But what you need to do is, of course, change the font to something other than just miscellaneous fixed. And you can actually use the standard XFT format. So what I'd set is I set my font, the standard font to be Ubuntu weight equals bold. So I want Ubuntu font bold pixel size equals 11. So the size is 11. I want it any alias. So any alias equals true. And I also set hinting equals true. So if I show my bar again, this font here that you're saying for the workspaces right here, all of this section here on the left hand side, that is Ubuntu font weight, bold pixel size 11, any alias. Now, one of the questions I often get about XMO bar and especially my XMO bar is the little Unicode emojis here, you know, the glyphs here, like the Penguin glyph and the computer monitor glyph and all of these. You know, how did I get those? Well, you get those by having a font listed that can display those special kinds of glyphs, those Unicode emoji characters. And what you need to do is XMO bar in the example config, if you grab the example config, they have the line under font is additional fonts equals. And then in brackets here, it's empty. You actually need to include some extra fonts. What I would do is include at least one extra font that you know has some of those Unicode glyph supports. And what I did is I included mononoke nerd font pixel size 11, any alias true, hinting equals true. Because I know mononoke nerd font has a lot of those special glyphs enabled in it. So that's what I use to display those, you know, like the little Penguin and the computer icons and all of that. I also set font awesome pixel size equals 13 as an additional font, although I don't think I actually use any awesome fonts in my config. I have it listed in the config file just in case I ever want to use it. I also have it listed in my XMO bar RC just so you guys can see that if you guys want to use font awesome, it is available. And the man page actually discusses font awesome a little bit if you read the XMO bar man page. The next thing in my config, we're setting background color foreground color. So the background color I set to this dark grayish blue color is similar to the background color in my Emax and in my terminals. That's the same background color I'm using in my XMO bar, the 282C34 color. Then foreground color is a lighter color. Now I'm using a bunch of different colors in my XMO bar, but the actual foreground color that's this light color I believe is this color here that you're seeing for the window titles. And then the next thing we set is position. Now there's several different things you can do setting the position for XMO bar. Typically the only thing you need to do is set the position to either top or bottom and it's going to fill up the entire width of the top or the bottom of the screen because I'm doing three different XMO bars on three different screens. I have to do things a little differently. I have to actually specify the X and Y coordinates for my bars because instead of it being at zero by 1920 I'm actually doing 1920 three times because I've got three monitors. So the one I'm working on now, the exposition actually starts at 1920 because this is the second monitor. If the first monitor, the exposition would start at zero. I hope that makes sense. The third monitor, the exposition would start at 3840. Again, that may seem a little complicated, but just know that's because I'm using multi monitors and I've got three different XMO bars running. Now typically you don't have to do this. If you're running XMO bars, if you're running the same XMO bar on all three monitors, you don't have to worry about this. You just set XMO bar to start at the top or the bottom and you're going to have the same XMO bar on every monitor. But again, I'm running three different ones. Next two settings were actually in the default config and I just left them as is lower on start equals true and hide on start equals false. I'm not exactly sure what those mean. I would have to go to the man page and lower on start. It looks like when true, the window is sent to the bottom of the window stack. Initially, I don't know what that means because typically your panels are not managed by the tiling window manager. As far as it's not part of the window stack, hide on start is when set to true, the window is initially not mapped, i.e. it's hidden. Okay, not again. I'm not exactly sure what those do, but I just left those as the default settings. Again, typically your panels such as XMO bar are not really managed in the window stack of your tiling window manager anyway. So I'm not sure if these are even really necessary to be in the config, but I'm going to leave them. The next one is all desktops equals true. This means XMO bar should appear on all our desktops. The next setting is persistent equals true. I believe that's also one of the default settings in the standard XMO bar example config persistent. I'm assuming that means the XMO bar should always be there. It shouldn't be able to be hidden even though I'm hiding mine, but I'm actually not hiding it. What I'm doing here is actually nothing to do with XMO bar. I have a key binding for my windows. The window with focus will go 100% of the screen without a border. So that's what I'm doing. It's actually that key binding actually is not doing anything to XMO bar. It's actually doing something to the window that has focus at the time. Now those first few sections here, these are pretty self-explanatory. Most people don't have questions about any of that stuff, except the additional fonts. A lot of you guys are not including additional fonts in your XMO bar config. That's why you're not getting those unicode emojis. So make sure you use proper additional fonts. But where all the action happens is the next section is, well, let me explain icon root. If you use icons in your XMO bar and I use one icon this year, that Haskell logo there. That actually is an XPM image and it needs to be an XPM image. It can't be a ping or a yuf or anything like that. And if you want to use icons, you can. You have to specify where those icons that you're using are located on your system. It has to be somewhere in your home directory. So I put it in slash home slash dt slash dot XMO net because that's where your XMO net config is slash. I created a directory called XPM slash. And in that directory, I have an image. I think I called it Haskell dot XPM. And later in my config, I will call upon that image. But really where all the magic happens in the config is this next section commands equals. And then in brackets here, we have various modules that are commands, commands that run and then we take the output of those commands and we output it into the XMO bar. So for example, the very first one now this dash dash is a comment dash dash time and date. I left that comment for you guys to let you guys know that this next line is the date module for XMO bar and how you run it is you type the word run space name of module and you can actually search the XMO bar man page for all the modules that are possible. If I go down, I will eventually get to a list of yeah, starting right here with the weather module, network interface, wireless interface, memory swap, CPU, multi CPU battery. There's a lot of modules and of course you can create your own custom modules as well. But there's one called date. So I'm running the date module and then you can specify the format of date. Now, all of this is in the XMO bar man page. But what I'm doing is I'm specifying the format as this tag here, this FN tag. So I'm doing inside the the Chevron is the greater than less than sign. I'm doing FN equals one. Now, what does that mean? That means I want to use a different font than the standard font. Without that tag, everything in the XMO bar config will use the standard font, which is a boon to bold. I want to use one of the additional fonts and the one I want to use, I want to use the first one, which is FN. That's the additional fonts equals one, which is the first one, mononoke nerd font. And then what do I want to display? I want to display a glyph and that is the code, the hex code for the glyph slash XF one three three. And what does that display? Well, that displays where's the date right here. That displays the little calendar Unicode character. That is exactly what's going on there. And then the closing FN tag and then percent sign B percent sign D percent sign capital Y. That is the format for the date January 21, 2021 and then dash because I have a dash here. And then inside parentheses, you see, I have parentheses for the time and the time, of course, is percent sign capital H colon percent sign capital M. So that's hours, minutes, of course. And then I have a closing quote. And then I have another opening and closing quote with the word date in it. Now, what does the next set of quotes with the word date in it? What does that do? Well, what that does is we set a name for this command, this run date, and then all the formatting options. We need to set it a name. I give it this name date because later in the config, we're going to call upon this command. And I just want to be able to simply refer to this whole command as date. So that's what the second set of quotes behind each of these commands are. It's just giving it a name. And then finally, after the second set of quotes, you need to give it a number. The number is how often should we run this command? These numbers are desi seconds, meaning tenths of a second. So I want to run it 50 desi seconds, which is actually just five seconds. So every five seconds, I want you to rerun the time and date command. Of course, if I was showing seconds, if I was instead of just doing hours and minutes, I was showing seconds, I probably would want to set that to 10, which would be one second change. But because I'm not really showing seconds, I don't need it to run every second, every five seconds, 10 seconds, even every minute would be plenty for what I'm doing. Now that we showed you that command, the rest of them are very similar. Run network is the network command. You need to give it the name of your interface, which is if you run the if config command, you know, get the name of your ethernet connection. In my case, it's NP6SO. And then the same thing as before, you have to give it various options. You again, research the man page, because the options are a little different for the network command than the date command. Again, I'm using some fancy fonts. You see FN equals one. Again, we're going to use the mononoke nerd font to display some glyphs. And for the network connections, the glyphs are the up arrow inside a circle and the down arrow inside a circle for up speed and down speed. And of course, we're running that network command every 20 desi seconds, which is actually every two seconds. So let me toggle truncate lines here in do me max because I've got some line wrapping going on and it's making things hard to read. Now the command section, that's where you include all the commands you want to run. You can actually include custom commands. You see run com. What that is, is that is a custom command that's not built into Xmobar. This is it can be any command. It can be a terminal command such as run com and then in quotes you name. What does that mean? It runs the standard you name command in your shell. And then inside the brackets inside the quotes dash R that's telling it to run you name with a dash R flag and then thirty six hundred is thirty six hundred desi seconds. Now when you start adding multiple flags to a shell command, it gets kind of hard to figure out exactly what to do in these brackets because you have to have quotes around I think every flag. It's a little confusing what I have found if you're running a complicated shell command instead of trying to run it directly, you know, with run com and then the name of that command actually make a script, which is what I did on this line here run com and then the path to this script that I call pack update. It just shows me how many updates are available in Pac-Man right now. And then I named it, of course, pack update, which will call upon pack update later in this config. And I want you to run that every thirty six thousand desi seconds, which I believe is every hour it runs this command. And if I opened up a terminal and I actually just ran my pack update script, let it run for a second, you see two hundred ninety four updates was the output from that terminal command. And if I go back to the X Mobar, you see I have this little bell icon, two hundred ninety four updates. You know, that is where it runs that pack update script for me and it takes the output and it places it in X Mobar. Now, once you have the command section to your liking, you have all your modules later in the config, you have template equals and then a opening quote and a closing quote. And your template equals may not be nearly as long as what mine is. This is a very long line for me is because I have a lot of stuff going on because I'm using a lot of different fonts, a lot of different font colors. I've got some other stuff going on such as action equals X do tool. I'm setting a key binding for something by default X Mobar does not accept key commands as far as mouse commands. So me clicking on anything does nothing at the moment. I can turn that functionality on. I will show you how to do that in just a second. If you want to have mouse clicking available in your X Mobar, you need to have this line in your command section. The very last line run unsafe standard in reader. Typically what this is going to be in a default config is going to say run standard in reader, which is the non clickable X Mobar change that to run unsafe standard in reader and that doesn't immediately get you the clicking of the mouse working. You have to also do something in your X mode and config as well, but make sure you have unsafe standard in reader. Then in template somewhere in template, you should have percent sign unsafe reader percent sign. Every command that you reference from the commands here needs to be wrapped in percent sign. So percent unsafe standard reader percent is actually this entire section here. Everything on the left hand side. All of this on the left hand side is not defined in your X Mobar config is actually defined in the X Monad config. If I go to the very bottom of my X Monad config, where I have my main block, you somewhere in your X Monad dot HS, you should have main equals do, which is your main block is where everything is executed in X Monad, you know, all your config all comes together in the main block here. And then my main block I have various spawn pipes where I'm telling it to spawn three different X Mobars with three different X Mobar configs and somewhere in your main block you also have log hook equals and then a whole bunch of other stuff somewhere in your log hook you need to have all of this or not all of it, but you may want some of it, you may not but you need PP output equals PP is a pretty printer function for Haskell. And it's basically saying I want you to take the output from my X Mobar processes and you know, where do I want you to put that? I want you to put that in X Mobar. PP current is the current workspace in X Mobar. So PP current equals X Mobar color. I define a color for it. I tell it to wrap it in brackets. So the current workspace I'm on is www. You see the color I've set is green and I've defined my current workspace to be wrapped in brackets. You see how that works? So that's PP current, you know X Mobar color. I set the color and then I set it to wrap in brackets. The next line PP visible is all visible workspaces. I want those set to a color. I don't want those wrapped in anything. That's why I didn't include a wrap command. So all of my visible workspaces right now are the first workspace. Dev is visible. That's why it's green instead of purple and my eighth workspace. Vid is visible right now because on my third monitor I have the eighth workspace video workspace open where I have OBS recording this video. And some of the other PP options that you want is PP hidden. That's your hidden workspaces. So that would be a hidden workspace that has a window on it. I don't have one currently. Let me create one. So I'm going to go to the fourth workspace. I'm going to open up a terminal. I'm going to go back to the workspace I was on and you see my fourth workspace is now blue in color. And it has a asterisk in front of it. That's letting me know. Hey, you're not currently viewing this workspace. That's why it's blue instead of green. But you do have something open on that workspace. That's just letting me know there's a window open on that. You might want to go and check it out. If you didn't know there was something there. Other PP configuration options include PP hidden no windows, which is workspaces that have no windows on them. So that's just any standard workspace that we're not actually using at the moment. That's all the purple ones. We also have PP title, which is the title window that appears in the bar. So that's this here. We have PP SIP, which is the separators between all the actions. So you see I have the pipe character as the separator here between the workspaces and the layout, which is currently the tall layout. Then I have a separator and two, two just is telling me there's two windows open on this workspace. And then I have a pipe separator again and then the window title. And we set PP urgent that sits the urgent color. If there's something that needs our attention right away. We have PP extras, which are extra modules that are normally not included in the PP output. And the extra module I wanted to include is the window count. This is not something that's normally displayed in X-Mobar, but I wanted it. So I set PP extras to include window count. And then to actually make that show up, I also needed to do this command here, PP order where I set the order of everything that shows up on this left-hand side of the screen. I set the order to be, and I set the order to be workspace layout, then the extras, which is the window count and that's the number two here. And then the T is the title of the window that currently has focus. I hope all of that makes sense. And there are many, many more of these PP command, the modules that you need to add to your log hook inside your Xmonad.hs. If you wanna include some extra stuff here, let's see if I can look up on Haskell.org. All of this is actually found in Xmonad.hooks.dynamiclog. And I go back to the top of my config and my imports, somewhere in my imports, I import Xmonad.hooks.dynamiclog. I have to import that module to use all those PP's. And then I specify all the ones. I'm gonna use dynamic log with PP, the wrap command, Xmobar PP, Xmobar colors, shorten, et cetera. And then let me get back down here and you see all of that. That's what I included here. And if we go back to the documentation for Xmonad.hooks.dynamiclog, somewhere there should be, yeah, this graph here, this PP shows you all the PP's we could have used. We could have used, I think I'm using most of the ones that are available, PP sort, I didn't use. That allows you to sort things in different orders. PP title sanitize, I didn't know that was available but that shows you the window title but it does an escape sanitize function on it. We also have PPWSsep, which is a separator to use between the workspace tags. That's another one I didn't know was available. So that would add a different separator between the workspaces because by default, your workspaces don't have separators. So if I wanted to use PPWSsep instead of the standard PPsep, well, I need that too, but I would just add a new line with PPWSsep and it would add separators in between the workspace names. I don't want that so I'm not gonna add it to my config but those of you that do want that, that's how you would achieve that. And again, I didn't know that was possible but just reading the documentation, it's very easy to figure most of this stuff out. Now, obviously you have to get used to the document and the more you play with this stuff, the more it gets comfortable for you. The last thing I want to mention is I did mention clickable workspaces. If you guys check out my Xmonad config, I've made it very easy for you guys that want clickable workspaces because I give you two examples in my config. I have standard non-clickable workspaces which is what I'm using right now. And then I have this section, clickable workspaces where I'm doing this here. And all you need to do is for clickable workspaces, well, I leave you a note here, to use clickable workspaces, be sure to have workspaces equals my clickable workspaces in the main at the bottom of this config. So workspaces equals my clickable workspaces in the main at the bottom of my config. So let's go to the bottom of my config and in the main block, we have workspaces equals my workspaces. But what it needs to be is my clickable workspaces. Let me escape, let me write this and now let me restart Xmonad, so do a quick restart. And now my workspaces should be clickable. So if I click on the fourth workspace here, I should go to it and I do. If I click on the first workspace, I go to it. So that's all you need to do for those of you using my config. Even if you're not using my config, you may want to copy some of my code blocks from my Xmonad.hs, because it really does make things easy by having two different workspace sections where I have non-clickable workspaces and clickable workspaces. It makes it very easy for me to swap between the two because all I have to do is change one line in my config. So if I was using clickable workspaces and I no longer needed them, well, you know, what I could do, I could just go back to workspaces equals my workspaces. Instead of my clickable workspaces, I could write this and let me recompile everything and restart everything. And now my XMObar no longer accepts clicking. I didn't want to spend too long on this topic because this video could run very long, especially if I went through everything that was in the XMObar documentation and everything that was in the Xmonad Hooks Dynamic Log documentation. But I think I gave you guys enough on camera to work with. Again, go grab my Xmonad config and my XMObar config. You don't have to use it, but just look at what I'm doing in my config. I'm also gonna link to the XMObar documentation. Read that page. It's long, but just read it. It'll take you, I don't know, 20 minutes to read through the whole thing. It's 20 minutes that long to figure out something that you're really trying to get working. I don't think it is. I'm also gonna link to the Xmonad.hooks.dynamiclogs module page because some of you guys are gonna wanna know about the various pp commands that you need to add to your Xmonad.hs. Now before I go, I need to thank a few special people. I need to thank the producers of this episode. Absi, Devin, Fran, Gabe, Rebenian, Mitchell, Lakami, Archvijay, Chris, Chuck, David. The other David, Donnie, Dylan, Gregory, Lewis, Paul, Pickvm, Scott, Wes, and Willie. They are the producers of the show. They are my highest tiered patrons over on Patreon. Without these guys, this video about configuring your XMObar panel in Xmonad, it wouldn't have been possible. You would not have heard me say pp a million times on camera today without each and every one of these guys. The show is also brought to you by each and every one of these ladies and gentlemen as well. All of these people, all these names you're seeing on the screen right now. These are all my supporters over on Patreon because the DistroTube channel is sponsored by you guys, the community. If you'd like to support my work, look for DistroTube over on Patreon. All right guys, peace.