My xmonad config for Ubuntu versions from 20.04 all the way back to 12.04! Including package list, config files, and instructions.
Haskell
416
22 commits
updated Aug 7, 2023
My xmonad config for Ubuntu 20.04 (Focal Fossa), including package list, config files, and instructions. If you're on a different Ubuntu LTS release, take a look at the different branches available to see if there is one for you. The master branch is typically for the newest LTS.
What you're looking at is my personal xmonad configuration setup, heavily commented and organized as clearly as I could manage.
I have been using some form of this setup on a daily basis since 2011 in my work as a web developer. An xmonad configuration usually ends up being a very individualized thing, but I thought it would be valuable to share this as a starting point for people new to xmonad. I know that when I was starting with xmonad I found reading other people's configuration files the best way to learn. I hope you will find this equally helpful.
This configuration has the following features and properties:
Warning: this is not thoroughly tested on 20.04. I only had to make minor updates to make it work, but I no longer regularly use it on a multi-screen configuration so I'm not able to easily test it there.
Perhaps you did a dist upgade to a new version of Ubuntu, and now when you get into Xmonad everything is a little... wonky. A likely cause of this is that the Xmonad session file which runs the configuration was reset to the package default. If so, you can fix this by copying my customized version of this file back into place.
sudo cp ~/.xmonad/xmonad.desktop /usr/share/xsessions/xmonad.desktop
This process is based on the assumption that you have not yet installed xmonad. If you HAVE already installed it, whether this will work is dependent on how you installed it:
Finally, this whole process is intended for someone who likes to mess with their system configuration and is comfortable at the command line. I'm guessing you probably wouldn't have found this if that wasn't the case.
As your first step, you should check out this github repository or download an archive of the files. The master branch is currently for 18.04; there are separate branches for older LTS releases of Ubuntu.
The contents of the repository should be placed in your home directory in a folder called ".xmonad". Note that if you have already installed xmonad, this directory will already exist! If you want to be able to revert to your existing configuration, you should rename this directory to something like ".xmonad-original".
I've provided a script which performs all the remaining operations lined out the installation instructions. PLEASE skim the rest of the installation section to see what the script does before running it. If you are happy with all the steps described, you can run the script as a shortcut. If there's anything you want to tweak during installation, you may be better off running the steps manually.
~/.xmonad/install-xmonad
If you prefer to perform these steps manually to understand what they are doing, read on.
This xmonad configuration uses a variety of different packages. Some of them are required for xmonad, others are not specific to xmonad but are core parts of the overall desktop configuration, and others are simply tools which I use frequently enough that my default configuration runs them on startup.
If you want to install the entire list of packages, you can run the following command:
sudo apt-get install xmonad libghc-xmonad-dev libghc-xmonad-contrib-dev xmobar xcompmgr nitrogen stalonetray moreutils synapse ssh-askpass-gnome suckless-tools
If you prefer to pick and choose, the following packages can be omitted while still maintaining the overall functionality:
To launch our xmonad session, we want to be able to pick it from the normal list of sessions available in Ubuntu's login screen. To make our customized version of Xmonad show up in the list, you will need to copy the file xmonad.desktop to the location where the greeter expects to find definitions of all the available sessions. You might also want to back up the default xmonad desktop session in case you want to revert later on.
sudo mv /usr/share/xsessions/xmonad.desktop /usr/share/xsessions/xmonad.desktop.original
sudo cp ~/.xmonad/xmonad.desktop /usr/share/xsessions
The default session picker as of Ubuntu Bionic is GDM3. Earlier versions user "Unity Greeter". GDM3 doesn't support any kind of representative icon for your sessions, but in case you are still using Unity Greeter, I have provided a suitable icon. Just copy the custom xmonad badge into the appropriate location for a nice consistent login experience.
sudo cp ~/.xmonad/images/custom_xmonad_badge.png /usr/share/unity-greeter
If you don't give Gnome some hints about how it should look, anything still based on Gnome 2 is going to be styled using Gnome 2 defaults -- that is to say, ugly. I've provided a configuration file which makes some configuration changes that make things look better, at least if you like dark styling. If you have already tweaked your .gtkrc-2.0 file or otherwise prefer not to replace this file, you can skip these steps. Everything should still be functional.
mv ~/.gtkrc-2.0 ~/gtkrc-2.0.original
ln -s .xmonad/.gtkrc-2.0 ~/.gtkrc-2.0
Once installed, xmonad will show up in GDM when you log in, where you normally choose which desktop you want to run. If you've just finished installing it:
In this section I provide a quick start guide to using xmonad, with an emphasis on the specific features of this configuration. Keybindings are provided in a format like mod-keyname, or mod-shift-keyname. In this configuration we are using the "super" key as the mod key, which on many keyboards is the windows logo key.
When you start xmonad for the first time, you're not looking at much. You will see a status bar near the top of your screen, and that's about it.
There are no menus for selecting programs to run. Everything is launched in one of two ways:
mod-shift-enter: launches a terminal window. You can run other programs from the terminal.ctrl-space: launches a Synapse prompt. You can run any program by starting to type its name, and then hitting enter once Synapse has found the program you want.Let's take a look at the status bar. Some of what's up there may not make much sense yet, but it will be useful to know about it as we go through the remaining sections of this guide.
The status bar can be divided into 6 major zones. Running from left to right we have:
If at any point you would like to reclaim some extra vertical space on your screen, you can toggle the visiblity of the status bar by hitting mod-b.
As you launch software, it will automatically be positioned on the screen following rules defined by your current "layout", which is like a strategy that xmonad uses to determine how windows should be positioned. At any time you can cycle through various layouts:
mod-space: cycle through the available layouts`mod-shift-space: jump to the default layoutNote that as you change your layout, the name of the current layout is displayed in the status bar, immediately after the list of workspaces.
There are six main layouts I have provided in my configuration:
Now would be a good time to try out the layouts to get a sense of what they offer. Hit mod-shift-enter several times to launch some empty terminals, and then experiment with hitting mod-space to cycle through the different layouts to see what they are like.
Once you've got multiple windows on the page and you actually start trying to use them, you'll probably find yourself wanting to manipulate the windows in various ways.
The currently focused window is outlined with a 1-pixel red border. The other, unfocused windows have a grey border.
You can change your focus as follows:
mod-j or mod-shift-tab moves your focus to the previous windowmod-k or mod-tab moves your focus to the next windowmod-m moves your focus to the master pane (see next section)Many xmonad layouts (but not all) make a distinction between a "master pane" and "everything else". By default, the first program launched on a workspace goes into the master pane. In most layouts, this means it is given priority over the other windows in some way; it may be larger, centrally located, or otherwise made more prominent.
Although by default there is just one window in the master pane, in some layouts it is possible to move more than one window into the master pane. They will evenly share the available space.
You can manipulate the contents of the master pane as follows:
mod-enter will swap the currently focused window with the contents of the master pane, making it the new master.mod-comma will make the master pane contain more windows, if the current layout supports this.mod-period will make the master pane contain fewer contains, if the current layout supports this.There are a couple of different ways you can resize windows in xmonad. These options are only available in the layouts that support them; in some layouts, you do not have control over the size of the windows.
mod-l and mod-h will grow or shrink the size of the master pane.mod-a and mod-z will grow or shrink the size of the currently focused window.The wonderful thing about resizing windows in xmonad is that all the other windows are moved to make room, so that the contents of all windows are always visible.
You can use mod-shift-c to close the focused window if you are done with it.
Now that you're creating, focusing, and resizing windows like crazy, you may find yourself running out of space on your screen. No worries, xmonad has got you covered with the concept of workspaces. Workspaces are similar to the idea of virtual desktops. However, unlike virtual desktops in most other window managers, workspaces are assigned names.
There are many ways to organize workspaces in xmonad, but I have chosen to associate them with keys on the number pad. Here's how you can think of the layout of workspaces which are provided by default in this configuration:
7:Chat 8:Dbg 9:Pix
4:Docs 5:Dev 6:Web
1:Term 2:Hub 3:Mail
0:VM Extr1 Extr2
Associating workspaces with number pad keys has a number of advantages:
The twelve workspaces I use are named for the kinds of work I regularly do. I have tried to train myself to always keep certain types of work on specific workspaces, because it makes it much easier to keep track of what I'm doing and find it again if I get interrupted.
You are likely to want to rename these to suit your own needs. Nevertheless, here's an explanation of what I use each workspace for in case it gives you some ideas:
You can use the following commands to change which workspace you are looking at:
mod-NUMBER: move to a workspace using its numbermod-KEYPADNUMBER: move to a workspace using its number (on the keypad)mod-ARROW: move to a workspace directionally, using the arrow keys. The workspaces are organized in a grid which matches the layout of the number pad.You can move the currently focused window to any workspace by simply adding "shift" to the commands listed above. So:
mod-shift-NUMBER: move a window to a workspace using its numbermod-shift-KEYPADNUMBER: move a window to a workspace using its number (on the keypad)mod-shift-ARROW: move to a window to workspace directionally, using the arrow keys. The workspaces are organized in a grid which matches the layout of the number pad.Note that when you move a window to a workspace using numbers or the keypad, the window is sent to that workspace but your focus stays on the same workspace you were on. However, when you move a window to a workspace using the arrows, your focus goes along with the window.
There are two workspaces which have a special configuration. They are locked to a special layout, and certain programs will always spawn on those workspaces.
Multiple monitor support in xmonad can take some doing to set up and get comfortable with, but once you are used to it, you will find it extraordinarily powerful.
What makes xmonad's monitor support different from traditional window managers is that your virtual desktops are not linked together in pairs, but are instead completely independent. In other words, you can instantly place any workspace on any screen, and then place any other workspace on another screen. You have complete control over what you want to see on each of your screens.
Getting multiple monitors working in xmonad is tricky, and more than I can thoroughly document here. I have had the best luck using the command line tool xrandr. In order to get your configuration working to your liking, you will probably have to tweak the Screen Configuration section of the start-xmonad file. The example xrandr commands I have provided should be a helpful starting point.
Depending on the relative positions of your screens you may also need to tweak xmonad.hs to modify which screen each of the screen seletion key refers to. Otherwise, they may be in the wrong order, which can be confusing. I prefer that the screen selection keys are in the same order on my keyboard as the monitors they refer to are physically located.
In my default configuration, I have two screens and I use "w" to refer to the left and "e" to refer to the right screen.
mod-w moves the focus to the left screenmod-e moves the focus to the right screenOnce you have a screen focused, you can use the regular workspace selection keys to put whatever you want on the focused screen.
The following commands involve quitting or restarting xmonad:
mod-shift-q: quits xmonad, returning to the login screen.mod-q: restarts and recompiles xmonad. Does not require restarting any other programs you may be running, and happens very quickly. Very useful while experimenting with changes to your xmonad.hs file!You can lock your screen using the following command:
mod-shift-l: runs slock screen locking programWhen the screen is locked, there won't be any interface shown for logging back in! Just type your password and hit enter to unlock the screen.
This section discusses making change to this xmonad configuration. There are no GUI tools for accomplishing this; everything is handled through configuration files. I have extensively commented all my configuration files and tried to make things as clear as possible; for the most part you should refer to the configuration files themselves for documentation. What I provide here is more like a map of where to start looking for specific pieces of functionality.
To change your wallpaper, locate a director which contains some images you would like to use for wallpaper. Then run the following at the command line:
nitrogen /path/to/your/images
You will be presented with a GUI interface for selecting your wallpaper.
The start-xmonad file runs during the login process, BEFORE xmonad itself has run. It runs a number of configuration tools, and starts some components used by the xmonad configuration.
You should take a look at the start-xmonad file if you want to make any of the following kinds of changes:
If you make changes to start-xmonad, the only way to see the changes is to log out of xmonad and log back in using mod-shift-q. This can make testing changes to this file a little tedious.
The startup-hook script runs immediately after xmonad is initialized, via the startupHook mechanism of xmonad itself.
You should take a look at editing the startup-hook script if you want to modify any of the software that is started by default, such as:
Note that by default I have commented out the ssh keychain unlocking prompt, assuming that this would be annoying when getting started with xmonad. If you are a heavy ssh user you might consider uncommenting that feature.
The xmobarrc file is used to configure the ovreall appearance of the status bar, as well as provide part of its content. You should consider editing it if you want to make any of the following kinds of changes:
stalonetrayrc as well in this caseYou can see whether the changes you have made to xmobarrc have been effective by recompiling xmonad using mod-q. This typically happens very quickly. If you try this and your status bar disappears, it means you made a syntax error in your configuration file. Undo the change and hit mod-q again to confirm things are working again.
The stalonetrayrc file is used to configure the icon tray at the top right of your screen. You should consider editing it if:
The xmonad.hs file is the main xmonad configuration file. Actually, it's not really a configuration file, but a Haskell program. This can make its syntax a little daunting to grasp.
I have done my best to format the file in a comprehensible manner and provide extensive comments. Still, editing this file can be a little risky. It's best to make small changes and compile frequently (using mod-q) to test if your changes work. If you get an error message, simply undo your change and compile again.
You should take a look at xmonad.hs if you want to:
The get-volume script is a small utility used by xmobar to display volume information in the status bar. I borrowed it completely unchanged from a blog post. In some cases, it may not work for your hardware and need to be modified.
In particular I have noticed problems with machines that have more than one sound card. On my machine I was able to fix this by modifying one line of the script:
# I changed this first line of the script:
str=`amixer sget Master,0`
# so that instead it read like this:
str=`amixer -c 1 sget Master,0`
I use a documentation browser tool called Zeal and when I started it up, my UI fonts were teensy-tiny. Turns out this is because Zeal is a Qt application, with completely separate font configuration from GTK applications. There is some kind of bug with Qt that I have not been able to work around yet.
If this is a big issue for you you might want to check out the QT environment variables for scaling your application: https://doc.qt.io/qt-5/highdpi.html#high-dpi-support-in-qt
Or, take a look at these related issues on Zeal's issue tracker:
Installing and running the qtconfig-qt4 command didn't seem to carry across to Zeal. I'm not sure why! Would appreciate any information about why this might be the case...
As of this writing, the current version of Synapse has a bug which prevents you from changing the activation key. You can change it, but when you quit and restart Synapse or restart you computer it will revert to the default Ctrl-Space.
If you are a user of GIMP, you may have found the GIMP experience in xmonad somewhat lacking while using versions before 2.8. This is because xmonad tries to manage all your palettes as tiles which can lead to a somewhat confusing interface. However, with GIMP 2.8 (the default version in Ubuntu versions from 14.04 on), single-window mode has been introduced.
It's highly recommended to turn single window mode on when using Gimp. In the "Windows" menu, choose "Single-Window Mode" to activate it.
I have an nVidia graphics card in my laptop, and I had some problems when I was using the proprietary nVidia drivers. In particular I had a very difficult time getting fonts to look the way I expected. I have had more luck with the Nouveau driver in my particular scenario. On other machines I have tried (also with nVidia cards), the proprietary drivers worked fine. It might be worth experimentation.
Haskell
60.6%
Shell
39.4%
My xmonad config for Ubuntu versions from 20.04 all the way back to 12.04! Including package list, config files, and instructions.
Haskell
416
22 commits
updated Aug 7, 2023
My xmonad config for Ubuntu 20.04 (Focal Fossa), including package list, config files, and instructions. If you're on a different Ubuntu LTS release, take a look at the different branches available to see if there is one for you. The master branch is typically for the newest LTS.
What you're looking at is my personal xmonad configuration setup, heavily commented and organized as clearly as I could manage.
I have been using some form of this setup on a daily basis since 2011 in my work as a web developer. An xmonad configuration usually ends up being a very individualized thing, but I thought it would be valuable to share this as a starting point for people new to xmonad. I know that when I was starting with xmonad I found reading other people's configuration files the best way to learn. I hope you will find this equally helpful.
This configuration has the following features and properties:
Warning: this is not thoroughly tested on 20.04. I only had to make minor updates to make it work, but I no longer regularly use it on a multi-screen configuration so I'm not able to easily test it there.
Perhaps you did a dist upgade to a new version of Ubuntu, and now when you get into Xmonad everything is a little... wonky. A likely cause of this is that the Xmonad session file which runs the configuration was reset to the package default. If so, you can fix this by copying my customized version of this file back into place.
sudo cp ~/.xmonad/xmonad.desktop /usr/share/xsessions/xmonad.desktop
This process is based on the assumption that you have not yet installed xmonad. If you HAVE already installed it, whether this will work is dependent on how you installed it:
Finally, this whole process is intended for someone who likes to mess with their system configuration and is comfortable at the command line. I'm guessing you probably wouldn't have found this if that wasn't the case.
As your first step, you should check out this github repository or download an archive of the files. The master branch is currently for 18.04; there are separate branches for older LTS releases of Ubuntu.
The contents of the repository should be placed in your home directory in a folder called ".xmonad". Note that if you have already installed xmonad, this directory will already exist! If you want to be able to revert to your existing configuration, you should rename this directory to something like ".xmonad-original".
I've provided a script which performs all the remaining operations lined out the installation instructions. PLEASE skim the rest of the installation section to see what the script does before running it. If you are happy with all the steps described, you can run the script as a shortcut. If there's anything you want to tweak during installation, you may be better off running the steps manually.
~/.xmonad/install-xmonad
If you prefer to perform these steps manually to understand what they are doing, read on.
This xmonad configuration uses a variety of different packages. Some of them are required for xmonad, others are not specific to xmonad but are core parts of the overall desktop configuration, and others are simply tools which I use frequently enough that my default configuration runs them on startup.
If you want to install the entire list of packages, you can run the following command:
sudo apt-get install xmonad libghc-xmonad-dev libghc-xmonad-contrib-dev xmobar xcompmgr nitrogen stalonetray moreutils synapse ssh-askpass-gnome suckless-tools
If you prefer to pick and choose, the following packages can be omitted while still maintaining the overall functionality:
To launch our xmonad session, we want to be able to pick it from the normal list of sessions available in Ubuntu's login screen. To make our customized version of Xmonad show up in the list, you will need to copy the file xmonad.desktop to the location where the greeter expects to find definitions of all the available sessions. You might also want to back up the default xmonad desktop session in case you want to revert later on.
sudo mv /usr/share/xsessions/xmonad.desktop /usr/share/xsessions/xmonad.desktop.original
sudo cp ~/.xmonad/xmonad.desktop /usr/share/xsessions
The default session picker as of Ubuntu Bionic is GDM3. Earlier versions user "Unity Greeter". GDM3 doesn't support any kind of representative icon for your sessions, but in case you are still using Unity Greeter, I have provided a suitable icon. Just copy the custom xmonad badge into the appropriate location for a nice consistent login experience.
sudo cp ~/.xmonad/images/custom_xmonad_badge.png /usr/share/unity-greeter
If you don't give Gnome some hints about how it should look, anything still based on Gnome 2 is going to be styled using Gnome 2 defaults -- that is to say, ugly. I've provided a configuration file which makes some configuration changes that make things look better, at least if you like dark styling. If you have already tweaked your .gtkrc-2.0 file or otherwise prefer not to replace this file, you can skip these steps. Everything should still be functional.
mv ~/.gtkrc-2.0 ~/gtkrc-2.0.original
ln -s .xmonad/.gtkrc-2.0 ~/.gtkrc-2.0
Once installed, xmonad will show up in GDM when you log in, where you normally choose which desktop you want to run. If you've just finished installing it:
In this section I provide a quick start guide to using xmonad, with an emphasis on the specific features of this configuration. Keybindings are provided in a format like mod-keyname, or mod-shift-keyname. In this configuration we are using the "super" key as the mod key, which on many keyboards is the windows logo key.
When you start xmonad for the first time, you're not looking at much. You will see a status bar near the top of your screen, and that's about it.
There are no menus for selecting programs to run. Everything is launched in one of two ways:
mod-shift-enter: launches a terminal window. You can run other programs from the terminal.ctrl-space: launches a Synapse prompt. You can run any program by starting to type its name, and then hitting enter once Synapse has found the program you want.Let's take a look at the status bar. Some of what's up there may not make much sense yet, but it will be useful to know about it as we go through the remaining sections of this guide.
The status bar can be divided into 6 major zones. Running from left to right we have:
If at any point you would like to reclaim some extra vertical space on your screen, you can toggle the visiblity of the status bar by hitting mod-b.
As you launch software, it will automatically be positioned on the screen following rules defined by your current "layout", which is like a strategy that xmonad uses to determine how windows should be positioned. At any time you can cycle through various layouts:
mod-space: cycle through the available layouts`mod-shift-space: jump to the default layoutNote that as you change your layout, the name of the current layout is displayed in the status bar, immediately after the list of workspaces.
There are six main layouts I have provided in my configuration:
Now would be a good time to try out the layouts to get a sense of what they offer. Hit mod-shift-enter several times to launch some empty terminals, and then experiment with hitting mod-space to cycle through the different layouts to see what they are like.
Once you've got multiple windows on the page and you actually start trying to use them, you'll probably find yourself wanting to manipulate the windows in various ways.
The currently focused window is outlined with a 1-pixel red border. The other, unfocused windows have a grey border.
You can change your focus as follows:
mod-j or mod-shift-tab moves your focus to the previous windowmod-k or mod-tab moves your focus to the next windowmod-m moves your focus to the master pane (see next section)Many xmonad layouts (but not all) make a distinction between a "master pane" and "everything else". By default, the first program launched on a workspace goes into the master pane. In most layouts, this means it is given priority over the other windows in some way; it may be larger, centrally located, or otherwise made more prominent.
Although by default there is just one window in the master pane, in some layouts it is possible to move more than one window into the master pane. They will evenly share the available space.
You can manipulate the contents of the master pane as follows:
mod-enter will swap the currently focused window with the contents of the master pane, making it the new master.mod-comma will make the master pane contain more windows, if the current layout supports this.mod-period will make the master pane contain fewer contains, if the current layout supports this.There are a couple of different ways you can resize windows in xmonad. These options are only available in the layouts that support them; in some layouts, you do not have control over the size of the windows.
mod-l and mod-h will grow or shrink the size of the master pane.mod-a and mod-z will grow or shrink the size of the currently focused window.The wonderful thing about resizing windows in xmonad is that all the other windows are moved to make room, so that the contents of all windows are always visible.
You can use mod-shift-c to close the focused window if you are done with it.
Now that you're creating, focusing, and resizing windows like crazy, you may find yourself running out of space on your screen. No worries, xmonad has got you covered with the concept of workspaces. Workspaces are similar to the idea of virtual desktops. However, unlike virtual desktops in most other window managers, workspaces are assigned names.
There are many ways to organize workspaces in xmonad, but I have chosen to associate them with keys on the number pad. Here's how you can think of the layout of workspaces which are provided by default in this configuration:
7:Chat 8:Dbg 9:Pix
4:Docs 5:Dev 6:Web
1:Term 2:Hub 3:Mail
0:VM Extr1 Extr2
Associating workspaces with number pad keys has a number of advantages:
The twelve workspaces I use are named for the kinds of work I regularly do. I have tried to train myself to always keep certain types of work on specific workspaces, because it makes it much easier to keep track of what I'm doing and find it again if I get interrupted.
You are likely to want to rename these to suit your own needs. Nevertheless, here's an explanation of what I use each workspace for in case it gives you some ideas:
You can use the following commands to change which workspace you are looking at:
mod-NUMBER: move to a workspace using its numbermod-KEYPADNUMBER: move to a workspace using its number (on the keypad)mod-ARROW: move to a workspace directionally, using the arrow keys. The workspaces are organized in a grid which matches the layout of the number pad.You can move the currently focused window to any workspace by simply adding "shift" to the commands listed above. So:
mod-shift-NUMBER: move a window to a workspace using its numbermod-shift-KEYPADNUMBER: move a window to a workspace using its number (on the keypad)mod-shift-ARROW: move to a window to workspace directionally, using the arrow keys. The workspaces are organized in a grid which matches the layout of the number pad.Note that when you move a window to a workspace using numbers or the keypad, the window is sent to that workspace but your focus stays on the same workspace you were on. However, when you move a window to a workspace using the arrows, your focus goes along with the window.
There are two workspaces which have a special configuration. They are locked to a special layout, and certain programs will always spawn on those workspaces.
Multiple monitor support in xmonad can take some doing to set up and get comfortable with, but once you are used to it, you will find it extraordinarily powerful.
What makes xmonad's monitor support different from traditional window managers is that your virtual desktops are not linked together in pairs, but are instead completely independent. In other words, you can instantly place any workspace on any screen, and then place any other workspace on another screen. You have complete control over what you want to see on each of your screens.
Getting multiple monitors working in xmonad is tricky, and more than I can thoroughly document here. I have had the best luck using the command line tool xrandr. In order to get your configuration working to your liking, you will probably have to tweak the Screen Configuration section of the start-xmonad file. The example xrandr commands I have provided should be a helpful starting point.
Depending on the relative positions of your screens you may also need to tweak xmonad.hs to modify which screen each of the screen seletion key refers to. Otherwise, they may be in the wrong order, which can be confusing. I prefer that the screen selection keys are in the same order on my keyboard as the monitors they refer to are physically located.
In my default configuration, I have two screens and I use "w" to refer to the left and "e" to refer to the right screen.
mod-w moves the focus to the left screenmod-e moves the focus to the right screenOnce you have a screen focused, you can use the regular workspace selection keys to put whatever you want on the focused screen.
The following commands involve quitting or restarting xmonad:
mod-shift-q: quits xmonad, returning to the login screen.mod-q: restarts and recompiles xmonad. Does not require restarting any other programs you may be running, and happens very quickly. Very useful while experimenting with changes to your xmonad.hs file!You can lock your screen using the following command:
mod-shift-l: runs slock screen locking programWhen the screen is locked, there won't be any interface shown for logging back in! Just type your password and hit enter to unlock the screen.
This section discusses making change to this xmonad configuration. There are no GUI tools for accomplishing this; everything is handled through configuration files. I have extensively commented all my configuration files and tried to make things as clear as possible; for the most part you should refer to the configuration files themselves for documentation. What I provide here is more like a map of where to start looking for specific pieces of functionality.
To change your wallpaper, locate a director which contains some images you would like to use for wallpaper. Then run the following at the command line:
nitrogen /path/to/your/images
You will be presented with a GUI interface for selecting your wallpaper.
The start-xmonad file runs during the login process, BEFORE xmonad itself has run. It runs a number of configuration tools, and starts some components used by the xmonad configuration.
You should take a look at the start-xmonad file if you want to make any of the following kinds of changes:
If you make changes to start-xmonad, the only way to see the changes is to log out of xmonad and log back in using mod-shift-q. This can make testing changes to this file a little tedious.
The startup-hook script runs immediately after xmonad is initialized, via the startupHook mechanism of xmonad itself.
You should take a look at editing the startup-hook script if you want to modify any of the software that is started by default, such as:
Note that by default I have commented out the ssh keychain unlocking prompt, assuming that this would be annoying when getting started with xmonad. If you are a heavy ssh user you might consider uncommenting that feature.
The xmobarrc file is used to configure the ovreall appearance of the status bar, as well as provide part of its content. You should consider editing it if you want to make any of the following kinds of changes:
stalonetrayrc as well in this caseYou can see whether the changes you have made to xmobarrc have been effective by recompiling xmonad using mod-q. This typically happens very quickly. If you try this and your status bar disappears, it means you made a syntax error in your configuration file. Undo the change and hit mod-q again to confirm things are working again.
The stalonetrayrc file is used to configure the icon tray at the top right of your screen. You should consider editing it if:
The xmonad.hs file is the main xmonad configuration file. Actually, it's not really a configuration file, but a Haskell program. This can make its syntax a little daunting to grasp.
I have done my best to format the file in a comprehensible manner and provide extensive comments. Still, editing this file can be a little risky. It's best to make small changes and compile frequently (using mod-q) to test if your changes work. If you get an error message, simply undo your change and compile again.
You should take a look at xmonad.hs if you want to:
The get-volume script is a small utility used by xmobar to display volume information in the status bar. I borrowed it completely unchanged from a blog post. In some cases, it may not work for your hardware and need to be modified.
In particular I have noticed problems with machines that have more than one sound card. On my machine I was able to fix this by modifying one line of the script:
# I changed this first line of the script:
str=`amixer sget Master,0`
# so that instead it read like this:
str=`amixer -c 1 sget Master,0`
I use a documentation browser tool called Zeal and when I started it up, my UI fonts were teensy-tiny. Turns out this is because Zeal is a Qt application, with completely separate font configuration from GTK applications. There is some kind of bug with Qt that I have not been able to work around yet.
If this is a big issue for you you might want to check out the QT environment variables for scaling your application: https://doc.qt.io/qt-5/highdpi.html#high-dpi-support-in-qt
Or, take a look at these related issues on Zeal's issue tracker:
Installing and running the qtconfig-qt4 command didn't seem to carry across to Zeal. I'm not sure why! Would appreciate any information about why this might be the case...
As of this writing, the current version of Synapse has a bug which prevents you from changing the activation key. You can change it, but when you quit and restart Synapse or restart you computer it will revert to the default Ctrl-Space.
If you are a user of GIMP, you may have found the GIMP experience in xmonad somewhat lacking while using versions before 2.8. This is because xmonad tries to manage all your palettes as tiles which can lead to a somewhat confusing interface. However, with GIMP 2.8 (the default version in Ubuntu versions from 14.04 on), single-window mode has been introduced.
It's highly recommended to turn single window mode on when using Gimp. In the "Windows" menu, choose "Single-Window Mode" to activate it.
I have an nVidia graphics card in my laptop, and I had some problems when I was using the proprietary nVidia drivers. In particular I had a very difficult time getting fonts to look the way I expected. I have had more luck with the Nouveau driver in my particular scenario. On other machines I have tried (also with nVidia cards), the proprietary drivers worked fine. It might be worth experimentation.
Haskell
60.6%
Shell
39.4%