You are not logged in.

#1 2008-06-02 06:24:40

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Looking for wmii-like xmonad config

Hi everyone.

I've been using wmii for 1-2 weeks and I feel right at home. The only thing I configured was to change the mod-key from Mod1 to Mod4. It manages windows well in a way that seems natural to me. However, it's limited. I can't resize clients with the keyboard.

I can do that in xmonad! Plus, I'm slowly learning Haskell, and configuring through understanding the short source code of the WM seems ideal.

I want to try xmonad. I don't have the courage to understand everything before having a comfortable environment, and I don't want to spend time in an uncomfortable environment in the hope that I will improve it in the future. So I'm asking your help for a jumpstart.

Please, I'd like a config that manages my windows like this:
* The clients do not move around from one column to another unless I tell them explicitly. They do not move or resize upon getting focus.
* I can move focus between clients with Mod4+h,j,k,l
* I can resize clients with something like Shift-Mod4+h,j,k,l

That's all I need to get comfortable. Does anyone have this at hand? Otherwise I'll stay with wmii and slowly RTFHaskellM.

Offline

#2 2008-06-03 02:51:18

vogt
Member
From: Toronto, Canada
Registered: 2006-11-25
Posts: 389

Re: Looking for wmii-like xmonad config

Windows don't normally resize when you focus them smile

The docs are pretty good; if you follow the examples, nothing goes wrong, and if you have an idea of what is going on, you can make quite flexible, and safe changes.

I use something like this, (except the mosaicAlt layout) with a couple more extensions (submap, prompts, windowNavigation...) and keybindings added on.

import XMonad
import XMonad.Hooks.DynamicLog 
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.ManageDocks
import XMonad.Layout.ResizableTile
import XMonad.Layout.NoBorders  
import XMonad.Util.EZConfig 
import XMonad.Util.Run
import System.IO (hPutStrLn)

main = do
  xmobar <- spawnPipe "xmobar"
  xmonad $ withUrgencyHook NoUrgencyHook $ defaults xmobar

defaults xmobar = defaultConfig
   { modMask         = mod4Mask
   , layoutHook       = smartBorders $ avoidStruts $ ResizableTall 1 (3/100) (1/2) [] ||| Full
   , logHook            = dynamicLogWithPP defaultPP
                         { ppCurrent   = xmobarColor "white" ""
                         , ppOutput    = hPutStrLn xmobar 
                         , ppTitle     = xmobarColor "orange" "" . shorten 110
                         , ppVisible   = wrap "(" ")"
                         , ppUrgent    = xmobarColor "green" "" . wrap "^" ""
                         , ppLayout    = xmobarColor "green" ""
                         }
   }
 `additionalKeysP`
 [("M-h", sendMessage MirrorShrink)
 ,("M-l", sendMessage MirrorExpand)
 ,("M-b", sendMessage ToggleStruts)
 ]

And no nasty piping via shell script to the status bar! Yay haskell.

So it appears that xmonad is succeeding at increasing the use of haskell.

PS: you need xmobar (since that is easiest to set up).

~/.xmobarrc:

Config { font = "-*-profont-*-*-*-*-11-*-*-*-*-*-*-*"
       , bgColor = "black"
       , fgColor = "grey"
       , position = Top
       , commands = [ Run Weather "CYYZ" ["-L","18","-H","27","--normal","green","--high","red","--low","lightblue"] 36000
                    , Run Network "wlan0" ["-L","0","-H","32","--normal","green","--high","red"] 10
                    , Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10
                    , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
                    , Run Memory ["-t","Mem: <usedratio>%"] 10
                    , Run Battery ["-L","50","-H","75","--high","green","--normal","yellow", "--low", "red"] 10
                    , Run Swap [] 10
                    , Run Com "uname" ["-s","-r"] "" 36000
                    , Run Date "%a %b %_d %Y * %H:%M:%S" "mydate" 10
                    , Run PipeReader "/home/adamvo/.xmonad.log" "xlog"
                    , Run StdinReader
                    ]
       , sepChar = "%"
       , alignSep = "}{"
       , template = " %StdinReader% }{ %cpu% | %memory% - %swap% | %eth0% - %wlan0% | <fc=orange>%mydate%</fc> | %battery% "
       }

edit: import System.IO will bring hPutStrLn into scope. Odd, since it did work for me without it.

Last edited by vogt (2008-06-12 21:17:17)

Offline

#3 2008-06-06 01:19:57

vogt
Member
From: Toronto, Canada
Registered: 2006-11-25
Posts: 389

Re: Looking for wmii-like xmonad config

bump! not interested sad?

Offline

#4 2008-06-06 20:11:38

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: Looking for wmii-like xmonad config

Oh sry, I am so lazy that I didn't even take the time to read your config. When I have a few hours to try it out I'll post some comments! Thanks

Offline

#5 2008-06-07 16:49:38

Zepp
Member
From: Ontario, Canada
Registered: 2006-03-25
Posts: 334
Website

Re: Looking for wmii-like xmonad config

I really would like my xmonad to behave more like wmii as well. I just wish wmii had xinerama support wink. Is there anyway to get the stacking layout like in wmii? (This would require having window titles as well.

Offline

#6 2008-06-09 21:31:16

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: Looking for wmii-like xmonad config

vogt, when I try your xmonad.hs, I get told that "hPutStrLn" is not defined in the scope. It actually works for you? Maybe I had a copy-paste error.

Anyway, I find xmonad to be pretty usable without much tweaking. Not as good as wmii yet, but it looks easier to tweak and more powerful. Here's my current xmonad.hs:

import XMonad
main = xmonad $ defaultConfig
    { terminal = "urxvt" 
    , modMask = mod4Mask }

I'll work my way up from that!

Next steps:
- changing alt to mod4 --> done!
- getting rid of the "master window" concept. I like all my clients to have equal priority
- starting in "horizontal division mode" rather than "vertical division mode" (finding a good layout algo I guess)

Last edited by peets (2008-06-10 01:15:06)

Offline

#7 2008-06-09 21:35:32

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: Looking for wmii-like xmonad config

I don't think you'll ever manage to resize the windows outside of the master area. That's the main thing that put me off from using Xmonad. I have come to the compromise of resizing manually just to enjoy the goodness and simplicity of wmii.

Good luck though!


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#8 2008-06-12 08:33:08

ragadab
Member
From: Khmelnitskiy, Ukraine
Registered: 2008-04-28
Posts: 3
Website

Re: Looking for wmii-like xmonad config

Zepp wrote:

I really would like my xmonad to behave more like wmii as well. I just wish wmii had xinerama support wink. Is there anyway to get the stacking layout like in wmii? (This would require having window titles as well.

i'm also searching for stack-like solution from wmii for xmonad, so any suggestions welcome smile

Offline

#9 2008-06-12 21:49:36

vogt
Member
From: Toronto, Canada
Registered: 2006-11-25
Posts: 389

Re: Looking for wmii-like xmonad config

@peets: it worked for me, (difference in the versions of the liabraries maybe?) but your problem will go away if you add import System.IO to the config (see the edit).
the mosaicAlt layout doesn't distinguish between the master and other windows when deciding the layout.

finferflu wrote:

I don't think you'll ever manage to resize the windows outside of the master area....

Now that's awfully pessimistic. (and the resizable tail lets you change the height of the window relative to the other ones in that column, and mosaicAlt gives each window exactly the relative area you specify)

So in terms of window management, you get to choose between controlling what happens, and specifying what you want:

In other words, floating windows -> manually split panes -> dwm-style dynamic tiling + variants

Offline

#10 2008-06-12 23:11:41

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: Looking for wmii-like xmonad config

Thanks vogt. In the meantime I learned some Haskell and my config is now this:

-- default config is in XMonad
import XMonad

-- ManageHooks handle new clients. Used to say "float this" or "send this to that workspace"
import XMonad.ManageHook

-- NoBorders's "smartBorders" layout removes borders around fullscreen apps
import XMonad.Layout.NoBorders

-- ResizableTile layout. Hopefully it's good!
import XMonad.Layout.ResizableTile

main = xmonad $ defaultConfig
    { terminal = "urxvt"
    , modMask = mod4Mask
    , manageHook = myManageHook <+> manageHook defaultConfig
    , layoutHook = smartBorders (ResizableTall 2 (3/100) (1/2) [] ||| layoutHook defaultConfig) }

myManageHook = composeAll [ resource =? "feh" --> doFloat ]

I'm not sure about the way I added the "ResizableTall" layout. It seems identical to the default XMonad layout, except that new windows are spawned in the current pane (master or stack) rather than always in the master pane. Is that what it's supposed to do?

Learning Haskell is fun. If I have the courage I could write my own layout eventually. It's pretty usable as-is though, and stable!

Offline

#11 2008-06-13 02:48:46

vogt
Member
From: Toronto, Canada
Registered: 2006-11-25
Posts: 389

Re: Looking for wmii-like xmonad config

ResizableTall allows the height of windows in either column to change, when you run the IO actions (not technically functions):

sendMessage MirrorShrink
sendMessage MirrorExpand

So to see how it is different, you have to bind keys to those actions, as in the config I posted (though maybe h and l aren't the best, since then you won't be able to change the width of the columns).

Offline

#12 2008-06-13 05:41:37

jbromley
Member
From: Pasadena, CA
Registered: 2007-02-04
Posts: 268

Re: Looking for wmii-like xmonad config

I modified the Accordion layout to be a bit more wmii-like. It divides the screen into 16 equal regions. Minimized windows get one region, while the main window gets the rest of the open regions. Think wmii without title bars. I know the 16 is an arbitrary limit kludge, but I'm just learning Haskell. Besides, with too many more than 16 sections (1400x1050 screen) you can't see what's in each window without having title bars. Here is a link to where you can get a PKGBUILD for xmonad-contrib with the mentioned change. I'm not sure how this layout will interact with the decorations module. My xmonad.hs shows how to set up this layout.

Regards.

Offline

#13 2008-06-13 14:56:49

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: Looking for wmii-like xmonad config

jbromley, I guess you're referring to the "stack" (is that what it's called?) layout scheme for wmii. I never really liked it. Here's some screenshots. The first is the default wmii config, which I like very much. The second is me faking it in xmonad.
screenshotwmiiki7.th.jpg screenshotkk4.th.jpg

In the first one, I can move between columns with mod+{h,l}. In the second, I can only alt-tab my way through (or mod-{j,k}, which is equivalent). The xmonad screenshot does not actually support columns. If a new client pops up, it will be in the slave pane, no matter whether I was currently working in the master or slave pane. I have to move it manually. It's not really usable.

I like the lack of titlebars in xmonad; there is a lot less clutter. Obviously though my wmii setup is more usable. Though I'm not giving up on xmonad.

Oh, and also: vogt: I added key mappings for those actions. I can resize windows with the keyboard with xmonad! Thank you!

Last edited by peets (2008-06-13 15:02:33)

Offline

#14 2008-06-13 22:02:59

jbromley
Member
From: Pasadena, CA
Registered: 2007-02-04
Posts: 268

Re: Looking for wmii-like xmonad config

Peets, yes, I was referring to the stack. When I use wmii it is my preferred layout. I see that you use the default mode. I also see what you mean about the window navigation. You can somewhat get around this by using the WindowNavigation module. It will let you bind keys to move and navigate windows. That might solve your navigation problem. The following shows what you need to do to set up this module.

import XMonad.Layout.WindowNavigation
...
    -- Window navigation for Wmii-Like layout
    [ ((modMask, xK_Right), sendMessage $ Go R)
    , ((modMask, xK_Left ), sendMessage $ Go L)
    , ((modMask, xK_Up   ), sendMessage $ Go U)
    , ((modMask, xK_Down ), sendMessage $ Go D)
    , ((modMask .|. shiftMask, xK_Right), sendMessage $ Move R)
    , ((modMask .|. shiftMask, xK_Left ), sendMessage $ Move L)
    , ((modMask .|. shiftMask, xK_Up   ), sendMessage $ Move U)
    , ((modMask .|. shiftMask, xK_Down ), sendMessage $ Move D)]
    ++
...
myLayout = tiled ||| Full ||| wmii
  where
     tiled   = named "Default" (ResizableTall 1 (1/100) (1/2) [])
     wmii = windowNavigation (named "Wmii" (combineTwo (dragPane Vertical 0.01 0.5) (Accordion) (Accordion)))
...
defaults logPipe =  defaultConfig {
        ...
        -- hooks, layouts
        layoutHook         = myLayout,
        ... }

I also know what you mean about where windows pop up. I haven't found a good way to make windows show in a particular column. For me, they always show in the master window (in my wmii-like stack layout).

One question - what is it that keeps you with xmonad? It seems like you've got to do a good bit of work to get it working how you like, so it must have something to make you switch from wmii. I am a wmii user (testing out xmonad right now) and I liked the ability to have multiple programmable layouts. I like that it is completely customizable. I also like Haskell, so far.

Good luck.

Offline

#15 2008-06-14 14:20:29

N30N
Member
Registered: 2007-04-08
Posts: 273

Re: Looking for wmii-like xmonad config

peets wrote:

However, it's limited. I can't resize clients with the keyboard.

You can use the keyboard to resize if your using wmii-hg. wink

Offline

#16 2008-06-14 16:33:41

Zepp
Member
From: Ontario, Canada
Registered: 2006-03-25
Posts: 334
Website

Re: Looking for wmii-like xmonad config

N30N wrote:
peets wrote:

However, it's limited. I can't resize clients with the keyboard.

You can use the keyboard to resize if your using wmii-hg. wink

but what about xinerama support? tongue

Offline

#17 2008-06-14 16:48:31

peets
Member
From: Montreal
Registered: 2007-01-11
Posts: 936
Website

Re: Looking for wmii-like xmonad config

Thanks jbromley. I'm sticking with xmonad right now because it looks like it has a lot of potential. It looks easily hackable, sturdy, simple. It seems like it will be easy to configure to behave exactly like I want it to. wmii and dwm have some configuration options, but as far as I know one can't easily write their own layout algo. I guess it's also the same reason I use Arch. Maybe I'm naive too.

Offline

#18 2008-06-14 20:30:22

jbromley
Member
From: Pasadena, CA
Registered: 2007-02-04
Posts: 268

Re: Looking for wmii-like xmonad config

peets wrote:

Thanks jbromley. I'm sticking with xmonad right now because it looks like it has a lot of potential. It looks easily hackable, sturdy, simple. It seems like it will be easy to configure to behave exactly like I want it to. wmii and dwm have some configuration options, but as far as I know one can't easily write their own layout algo. I guess it's also the same reason I use Arch. Maybe I'm naive too.

That's cool, I was just curious because it seemed like wmii had everything you needed already. I agree with your reasons for liking xmonad. As I said, I am a long-time (since wmi-8 with some forays into other wms) wmi* user, I'm giving xmonad a couple of weeks as a try-out for the very reasons you cited (and for Haskell!) Anyway, good luck finding your perfect setup.

Regards.

Offline

Board footer

Powered by FluxBB