Jumping from I3 to xmonad - Day 1
Tags: xmonad, tilliing, wm
Published: 2020-11-28 11:44:06

---
title: Jumping from I3 to xmonad - Day 1
published: true
series: xmonad
tags: xmonad, tilliing, wm
---

I'm using I3 now for one and a half. My main browser is quteprowser, I have extend my I3 config with other custom mappings and got more familiar with bash and with my system as a whole as in the last 15 years as Linux user. But one thing which bugs me the most with I3 is, that it has no main/secondary window layout, where the main window takes more space then the other non focused windows. I hacked something together, which resized the window on focus automatically, but it is buggy if a third window in a column opened. 

And just because of this, I decided to switch my WM. But this small issue nags me every day multiple times, and I don't want to reorganize my Windows just because of my crappy script, but also don't want to invest the time to learn python and the API which would be necessary (I'm tackling Java and rust right now - thats enough). 

So, today I decided to switch from I3 to xmonad. A good starter tutorial is from DistroTube [Getting started with xmonad](https://www.youtube.com/watch?v=3noK4GTmyMw) it tackling the first big oofs.

I basically followed his recommendations, but I didn't copied his complete dotfiles.
I struggled here and there but the build in "help page" was very handy (mod+shift+/). I started to warm up, which needed some times. I changed already some of the basic key bindings, and migrated most of the startup actions and mappings from I3wm.

### Rofi application switcher.

I'm a heavy user of rofi as application launcher and window switcher. I noticed, that rofi didn't show my window list. This was fixed by importing EwmhDesktops.

`import XMonad.Hooks.EwmhDesktops`

```haskell
main = do 
        xmonad $ ewmh $ def {
        -- lots of other stuff
        } `additionalKeysP` myAddKeys

```

### Transparency
One of my problems was, that I lost my transparency of my unfocused window.
For compositing I am using picom. After some search I discovered that I have to change some value in the picom.conf:

```

detect-rounded-corners = true;
mark-ovredir-focused = false;
mark-wmwin-focused = true;
use-ewmh-active-win = true;

```

### Media keys

The second point, was to activate my media and brightness keys.
For this we need to import `XMonad.Util.EZConfig` 

```haskell
myAddKeys :: [(String, X ())]
myAddKeys =
    -- Xmonad
        [ 
         ("<XF86AudioMute>", spawn "pamixer -t")
        , ("<XF86AudioLowerVolume>", spawn "pamixer -d5")
        , ("<XF86AudioRaiseVolume>", spawn "pamixer -i5")

        , ("<XF86MonBrightnessUp>", spawn "xbacklight -inc 10")
        , ("<XF86MonBrightnessDown>", spawn "xbacklight -dec 10")

        ]
```

```haskell
main = do 
        xmonad $  def {
        -- lots of other stuff
        } `additionalKeysP` myAddKeys

```

I had also a real annoying problem with the `focus follow mouse`. xmonad was not responding, while the applications still accept input. After deactivating this feature it was never happened again.

```haskell
myFocusFollowsMouse :: Bool                                                           
myFocusFollowsMouse = False                                  
                                                                                                        
-- Whether clicking on a window to focus also passes the click to the window            
myClickJustFocuses :: Bool                                                              
myClickJustFocuses = True 

```

My whole configuration is [here - xmonad](https://github.com/mafflerbach/dotfiles/blob/master/xmonad/xmonad.hs) and [here - picom](https://github.com/mafflerbach/dotfiles/blob/master/i3/compton.conf)