-2

I am using XMonad and I want a layout that has at least three fixed 85 character wide windows and another window with a spiral like layout. (I have a large widescreen 34 inch screen)

I attempted to this using combinations but I didn't manage, any help/direction to examples will be appreciated.

Thanks!

  • 1
    Please note that Stackoverflow is for programming related questions only. Please review the [help/on-topic] for what topics can be asked here. This question *may* be appropriate on other SE sites such as [unix.se]. Check their help first to see if the question belongs there and if so you can click the "flag" link and select "in need of moderator attention" to request migration there. – kaylum Nov 08 '16 at 21:53

1 Answers1

2

It would be helpful, if you showed us, what you tried by now. Anyway here's an example on how to create several custom layouts.

You need to create a new layout in your .xmonad/xmonad.hs For this you need to have a little experience with haskell.

I've created several Layouts which can be used by pressing a specific key combination here's an example:

import the following:

import XMonad.Layout.Spacing
import XMonad.Layout.LayoutCombinators hiding ( (|||) )
import XMonad.Layout.Fullscreen
import XMonad.Layout.NoBorders
import XMonad.Layout.Reflect
import XMonad.Layout.Combo
import XMonad.Layout.TwoPane
import XMonad.Layout.Tabbed 
import XMonad.Layout.PerWorkspace
import XMonad.Layout.IM
import XMonad.Layout.Grid
import XMonad.Layout.FixedColumn
import XMonad.Layout.ThreeColumns
import Data.Raio((%))

And then you could do something like this:

sPx = 1

verticalLayout = spacing sPx $ avoidStruts $ reflectHoriz $ Tall 1 0.03 0.5
verticalLayoutLargeScreen = spacing sPx $ avoidStruts $ ThreeCol 1 0.03 0.5
horizontalLayout = spacing sPx $ avoidStruts $ Mirror $ Tall 1 0.03 0.5
webdevLayout = spacing sPx $ avoidStruts $ Tall 1 0.03 0.63
fullscreenLayout = noBorders $ fullscreenFull $ Full

myLayout =
    onWorkspace "2:web" (webdevLayout ||| fullscreenLayout) $ reflectHoriz $
                 (withIM (3%7) (ClassName "Profanity")
                 (verticalLayoutLargeScreen ||| Grid ||| Full |||
                 verticalLayout ||| horizontalLayout ||| fullscreenLayout))

After this define a mapping for your key combo:

myAdditionalKeys = [
    -- Switch to next layout:
    ((mod4Mask .|. shiftMask, xK_m), sendMessage NextLayout),
]

and then do not forget to add your layout and your key Mapping to the config, could look like this:

main = do
xmonad $ defaultConfig
         { manageHook = manageSpawn <+> myManageHook <+> manageDocks,
           layoutHook = myLayout,
           logHook = dynamicLogWithPP xmobarPP {
                   ppOutput = hPutStrLn xmproc,
                   ppLayout = (\ x -> ""),
                   ppTitle = xmobarColor "#b2ed00" ""
                 } >> updatePointer (Relative 0.99 0.99),
           modMask = mod4Mask,
           borderWidth = 4,
           normalBorderColor = "#777777",
           focusedBorderColor = "#ccff00",
           workspaces = myWorkspaces,
           focusFollowsMouse = True,
           terminal = "x-terminal-emulator"
         }
         `removeKeys` myRemoveKeys
         `additionalKeys` myAdditionalKeys
GiftZwergrapper
  • 2,602
  • 2
  • 20
  • 40