SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2010-10-17 13:47:08

Digit
#! Die Hard
From: the internet
Registered: 2009-05-26
Posts: 1,025
Website

My Xmonad Adventures

as this forum section is not just for openbox anymore,

i thought i'd start a thread for what is once again, my favorite window manager...  Xmonad.


my story.
so i'm only a couple days back in to using xmonad, and thanks to my previous experience with it, my xmonad.hs config file is already looking pretty robust and useful.

i want to keep the default xmonad controls (nearly... i change the mod key to the tux/win/super key), and incorporate a load of my keyboard shortcuts i've been using in openbox.   there are areas where i have to move my shortcuts though, as q, w, e, r, t, h, j, k, and l, are all taken up.
{edit, realised it's easier to start from scratch and do it manually, working around the key conflicts, than my previous notion)

i have been fidling with more advanced frankenstein-ery, and even managed to cause a couple of epic crashes.   which rather than annoy me, impressed me.  XD  i dont recall achieving that in xmonad before. lol.

anyways, here's my current stable xmonad.hs

(-edit, it's not a perfectly working xmonad.hs... i still need to get the managehook added to the "main = do")

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO

-- created with help of: http://www.haskell.org/haskellwiki/Xmonad/Config_archive/John_Goerzen%27s_Configuration
-- use "xmonad --recompile" to check it's syntactically correct if making changes (better than just modQ)
    -- list of key codes http://haskell.org/haskellwiki/Xmonad/Key_codes
    -- may also prove useful for some keys and commands http://hackage.haskell.org/packages/archive/X11/1.4.5/doc/html/Graphics-X11-Types.html
        -- may want to encorporate: http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-GridSelect.html
myManageHook = composeAll
    [ className =? "Gimp"      --> doFloat
    , className =? "pidgin"    --> doFloat
    , className =? "skype"     --> doFloat
    , className =? "vlc"       --> doFloat
    , className =? "tilda"     --> doFloat
    , className =? "Vncviewer" --> doFloat
    ]

main = do
    xmonad $ defaultConfig
        { modMask = mod4Mask     -- Rebind Mod to the Windows key
        } `additionalKeys`
        [ ((mod4Mask, xK_F2), spawn "gmrun")
        , ((mod4Mask, xK_F3), spawn "~/.config/dmenu/dmenu-bind.sh")
        , ((mod4Mask, xK_F4), spawn "kill")
        , ((mod4Mask, xK_F5), spawn "xfce4-appfinder")
        , ((mod4Mask, xK_F6), spawn "xkill")
        , ((mod4Mask, xK_a), spawn "audacity")
        , ((mod4Mask, xK_b), spawn "firefox")
        , ((mod4Mask .|. mod1Mask, xK_b), spawn "seamonkey")
        , ((mod4Mask, xK_c), spawn "pidgin & skype")
        , ((mod4Mask, xK_d), spawn "gedit")
        , ((mod4Mask .|. controlMask, xK_d), spawn "gksudo gedit")
        , ((mod4Mask, xK_f), spawn "pcmanfm")
        , ((mod4Mask .|. controlMask, xK_f), spawn "gksudo pcmanfm")
        , ((mod4Mask .|. shiftMask, xK_f), spawn "searchmonkey")
        , ((mod4Mask, xK_g), spawn "gimp")
        , ((mod4Mask, xK_m), spawn "vlc")
        , ((mod4Mask .|. mod1Mask .|. controlMask, xK_o), spawn "gedit")
        , ((mod4Mask, xK_m), spawn "vlc")
        , ((mod4Mask, xK_m), spawn "vlc")
        , ((mod4Mask, xK_x), spawn "gedit ~/.xmonad/xmonad.hs")
        , ((0, xK_Print), spawn "scrot '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/images/screenshots/ & gpicview ~/images/screenshots/$f'")
        ]

and perhaps i'll return shortly with an update... or maybe there are other xmonad users on crunchbang who'll chime in with their 2 cents too.  ^_^

Last edited by Digit (2010-10-17 13:57:18)

Offline

Help fund CrunchBang, donate to the project!

#2 2010-10-20 21:20:49

Digit
#! Die Hard
From: the internet
Registered: 2009-05-26
Posts: 1,025
Website

Re: My Xmonad Adventures

woohoo!
now have tint2 and xmonad playing nice together.
includes a toggle for tint2 visibility!  wink

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Hooks.EwmhDesktops
import XMonad.Config.Desktop
import System.IO

-- initially created with help of: http://www.haskell.org/haskellwiki/Xmonad/Config_archive/John_Goerzen%27s_Configuration
-- use "xmonad --recompile" to check it's syntactically correct if making changes (better than just modQ)
    -- list of key codes http://haskell.org/haskellwiki/Xmonad/Key_codes
    -- may also prove useful for some keys and commands http://hackage.haskell.org/packages/archive/X11/1.4.5/doc/html/Graphics-X11-Types.html
        -- may want to encorporate: http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-GridSelect.html
myManageHook = composeAll
    [ className =? "Gimp"      --> doFloat
    , className =? "pidgin"    --> doFloat
    , className =? "skype"     --> doFloat
    , className =? "vlc"       --> doFloat
    , className =? "tilda"     --> doFloat
    , className =? "Vncviewer" --> doFloat
    ]

main = do
    xmproc <- spawnPipe "/usr/bin/tint2 /home/digit/.config/tint2/tint2rc"
    xmonad $ ewmh desktopConfig
        { manageHook = manageDocks <+> myManageHook -- make sure to include myManageHook definition from above
                        <+> manageHook desktopConfig
        , layoutHook = avoidStruts  $  layoutHook defaultConfig
        , modMask = mod4Mask     -- Rebind Mod to the Windows key
        } `additionalKeys`
        [ ((mod4Mask, xK_F2), spawn "gmrun")
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_F2), spawn "gedit ~/.gmrunrc")
        , ((mod4Mask, xK_F3), spawn "~/.config/dmenu/dmenu-bind.sh")
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_F3), spawn "gedit ~/.config/dmenu/dmenu-bind.sh") -- edit dmenu
        , ((mod4Mask, xK_F4), spawn "close")
        , ((mod4Mask, xK_F5), spawn "xfce4-appfinder")
        , ((mod4Mask, xK_F6), spawn "xkill")
        , ((mod4Mask, xK_a), spawn "audacity")
        , ((mod4Mask, xK_b), spawn "firefox")
        , ((mod4Mask .|. mod1Mask, xK_b), spawn "seamonkey")
        , ((mod4Mask, xK_c), spawn "pidgin & skype")
        , ((mod4Mask, xK_d), spawn "gedit")
        , ((mod4Mask .|. controlMask, xK_d), spawn "gksudo gedit")
        , ((mod4Mask, xK_f), spawn "pcmanfm")
        , ((mod4Mask .|. controlMask, xK_f), spawn "gksudo pcmanfm")
        , ((mod4Mask .|. shiftMask, xK_f), spawn "searchmonkey")
        , ((mod4Mask, xK_g), spawn "gimp")
        , ((mod4Mask, xK_m), spawn "vlc")
        , ((mod4Mask, xK_n), sendMessage ToggleStruts) -- toggle panel visability.
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_n), spawn "gedit ~/.config/tint2/tint2rc") -- edit panel config
        , ((mod4Mask .|. mod1Mask, xK_n), spawn "pkill tint2 && tint2") -- restart panel.
        , ((mod4Mask .|. shiftMask, xK_p), spawn "gksudo gparted")
        , ((mod4Mask, xK_p), spawn "gksudo synaptic")
        , ((mod4Mask, xK_q), spawn "xmonad --restart")
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_x), spawn "gedit ~/.xmonad/xmonad.hs") -- edit xmonad config
        , ((0, xK_Print), spawn "scrot '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/images/screenshots/ &amp; gpicview ~/images/screenshots/$f'")
        ]

also pasted here:
http://hpaste.org/40729/xmonadhs_in_progress4

there are a few more shortcut additions and adaptation since my last update here too.

i'm no haskell pro, quite the noob actually, and so i make no gauruntees about the clean perfection of my code.   ... but it does seem to confer all functionality i saught.


i'm keen on the idea now of making a couple other configs....

one which far more accurately mimics the crunchbang controls, rather than my current haphazard adding in as much i can without changing default xmonad controls

and one which is entirely geared for artists... i.e. built for one hand on the keyboard and one on the mouse, as most graphics (image manipulation, vector, 3d) applications seem to hold as the standard hand positions.

Offline

#3 2010-12-12 16:39:00

cbrunos
#! Member
From: Strasbourg, France
Registered: 2009-09-22
Posts: 73
Website

Re: My Xmonad Adventures

Hey, happy to see other people use this fantastic WM!
I switched to Xmonad quite naturally, I got a 20" screen in July, and it's so big that I lost tremendous time resizing my windows, sending them to other desktops etc in Openbox. So I asked myself if it wasn't perhaps better to switch to a tilling wm…found Xmonad and never looked back to other wms! big_smile
I've been using it on Lucid Lynx and it's great. I won't share my xmonad.hs though, it's optimized for french bépo keyboards, I don't think it will interest a lot of people lol

Last edited by cbrunos (2010-12-12 16:39:57)


Xmonad is the best way to get things done, fast.
My french linux blog: http://cbrunos.wordpress.com

Offline

#4 2011-01-26 02:48:24

marcocen
Member
From: Montevideo, Uruguay
Registered: 2010-07-12
Posts: 10
Website

Re: My Xmonad Adventures

I'm so glad to find other people using xmonad
I made the switch today, but I'm loving it so far, but I have a few questions I'd like to ask you:
1) where do i have to put the commands I want to have executed at startup? I'm on a laptop and tap-click, network and sound are kind of a big deal, but I can't seem to find the config file to do that. Currently I'm just manually running a script i made, but i'd like to automate it.
2) I'm looking for a program that, when I press a keybind, shows a popup window with the tray icons, sort of like a floating systray. It would rock! In the meantime, I think I'll mod my tint config and use digit's keybind to hide/show it.
3) Can i arrange my windows in any way I like or I'm stuck with what the algorithms think is best? Don't get me wrong, I'm loving this WM, but I see myself in the near future trying to rearrange my tiled windows.
thanks for any replies

Offline

#5 2011-01-26 03:07:26

anonymous
The Mystery Member
From: Arch Linux Forums
Registered: 2008-11-29
Posts: 9,418

Re: My Xmonad Adventures

1. If you get rid of GDM, you could just use ~/.xinitrc to start all your apps.

2. If you just want a systray, take a look at stalonetray and trayer.

Offline

#6 2011-01-28 09:28:13

cbrunos
#! Member
From: Strasbourg, France
Registered: 2009-09-22
Posts: 73
Website

Re: My Xmonad Adventures

1) Check the statuphook section from you xmonad.hs file:

myStartupHook = do
      spawn "kupfer"
      spawn "trayer  --tint 0x4A4A4A --SetDockType true --SetPartialStrut true --edge top --align right --widthtype pixel --width 205 --heighttype pixel --height 6 --distance -1 --transparent true --alpha 0"
      spawn "bluetooth-applet"
      spawn "gtk-redshift -l 48.5:7.7"
      spawn "conky"

This will launch kupfer, trayer, conky, etc at startup.

2) You could use trayer, look at how I did in the startup hook.

3) There are a lot of different layouts. If you want to resize your windows and move them around, right click on them while holding your MOD key to resize, and left click while still holding your MOD key to move them around.

Last edited by cbrunos (2011-01-28 09:29:10)


Xmonad is the best way to get things done, fast.
My french linux blog: http://cbrunos.wordpress.com

Offline

#7 2011-01-28 16:35:57

marcocen
Member
From: Montevideo, Uruguay
Registered: 2010-07-12
Posts: 10
Website

Re: My Xmonad Adventures

Thanks a lot!  I managed to put my little startup script in there, not sure how, I'll have to check.
I'll take a look at trayer and stalonetrayer (love the name) and see wich fits my needs better

Offline

#8 2011-01-28 22:37:52

cbrunos
#! Member
From: Strasbourg, France
Registered: 2009-09-22
Posts: 73
Website

Re: My Xmonad Adventures

Glad I could help. Oh and by the way, I think i remember I couldn't get stalonetray to work with Xmonad, it would always get tiled. That's why I use trayer.


Xmonad is the best way to get things done, fast.
My french linux blog: http://cbrunos.wordpress.com

Offline

#9 2011-06-08 21:03:48

cbeans
New Member
Registered: 2011-06-06
Posts: 9

Re: My Xmonad Adventures

Just started using #! a week ago, and wanted to say thanks for inspiring me to marry it with XMonad, which (let's be honest with ourselves, here) is the sexiest window manager of all time. Here's what I've got as an xmonad.hs, which was built off of your work

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Hooks.EwmhDesktops
import XMonad.Config.Desktop
import System.IO

-- initially created with help of: http://www.haskell.org/haskellwiki/Xmonad/Config_archive/John_Goerzen%27s_Configuration

myManageHook = composeAll $
    map (\name -> className =? name --> doFloat) ["Gimp","skype","Do"]

main = do
    mapM spawnPipe [ "/usr/bin/tint2 /home/cbeans/.config/tint2/tint2rc"
                   , "xbindkeys"
                   , "xscreensaver"
                   , "parcellite"
                   , "synclient HorizTwoFingerScroll=1"
                   , "/home/cbeans/.dropbox-dist/dropboxd"
                   , "nm-applet"
                   , "bluetooth-applet"
                   , "xfce4-power-manager"
                   , "xfce4-volumed"
                   , "gnome-do"
                   , "guake"
                   , "feh --bg-center /home/cbeans/images/wallpapers/shared/crunchbang-logo-minimal.png"
                   ]

    xmonad $ ewmh desktopConfig
        { manageHook = manageDocks <+> myManageHook
                        <+> manageHook desktopConfig
        , layoutHook = avoidStruts  $  layoutHook defaultConfig
        , normalBorderColor = "grey"
        , modMask = mod4Mask
        , workspaces = ["α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι" ]
        }

As you can see, I've made it so that you can add new processes spawned at startup, or change which programs xmonad should ignore by simply editing the respective lists that get mapped over. Instead of using xmonad to manage hotkeys, I opted to deal with all of that inside of xbindkeys. I also have hella applets getting spawned to populate the systray at startup, and get wireless etc. up and running. Also got feh setting up a sexy crunchbang background, and I've set the workspace names to Greek letters because they're cooler than numbers. Conky works too, but I haven't been using it. I'm curious how you managed other startup programs though; I never got xinit loading?

Anyway, hope all this crap is useful to someone out there.

Offline

#10 2011-10-24 12:30:58

Digit
#! Die Hard
From: the internet
Registered: 2009-05-26
Posts: 1,025
Website

Re: My Xmonad Adventures

nice cbeans. smile

tho... doesnt that mean that all those apps start again when you restart xmonad?  i had that issue with my tint2 being started from my xmonad config.  (not a big issue, given i just need to alt-f6+click it, to xkill it.)

i like the xbindkeys idea.

kinda reminds me a little of my idea to use a stand alone menu app (not dependant on any one wm).  ...not that i've got anything particularly useful set up yet... just havnt gotten around to developing my idea further, but i use 9menusmile  it's a really nice little app. i had been tinkering around to see if i could get it autopopulated.
...never really implemented it yet tho.  thought it at least worth a mention.

my workstation's current config has bloated up as i've been trying out various new layouts... so many layouts, and only using a cycle-through-layouts.... this isnt quite as useful any more.  ... i really should have bit the bullet n gone n sussed out integrating layout combo / combinators by now.  but just so i can have a laugh at this looking back from some time in the future once i get it cleaned up, here it is:

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Hooks.EwmhDesktops
import XMonad.Config.Desktop
import XMonad.Actions.CycleWS
import XMonad.Layout.MouseResizableTile --and shrink/expand slave layout
import XMonad.Layout.Tabbed -- handy for uzbl
import XMonad.Layout.NoBorders
import XMonad.Layout.Grid
import XMonad.Layout.Combo
--import XMonad.Layout.LayoutCombinators hiding --( (|||) )
--import XMonad.Layout.Spiral
import XMonad.Layout.IM
import XMonad.Layout.Mosaic
import XMonad.Layout.MosaicAlt
import qualified Data.Map as M
import XMonad.Layout.ThreeColumns
import Data.Ratio ((%))
import System.IO

-- initially created with help of: http://www.haskell.org/haskellwiki/Xmonad/Config_archive/John_Goerzen%27s_Configuration
-- use "xmonad --recompile" to check it's syntactically correct if making changes (better than just modQ)
    -- list of key codes http://haskell.org/haskellwiki/Xmonad/Key_codes
    -- may also prove useful for some keys and commands http://hackage.haskell.org/packages/archive/X11/1.4.5/doc/html/Graphics-X11-Types.html
    -- many useful tips and tricks https://bbs.archlinux.org/viewtopic.php?id=40636
    -- 0.9 contrib, v.handy list of extensions http://xmonad.org/xmonad-docs/xmonad-contrib/index.html


-- also used 
-- no border fullscreen. http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-NoBorders.html
-- http://hackage.haskell.org/packages/archive/xmonad-contrib/0.8/doc/html/XMonad-Doc-Extending#Editing_mouse_bindings.html
-- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-MouseResizableTile.html
---- still need to learn how to change the size of the border gap between tiles now that a 6pixel gap has been adeed.  :/


-- yet to be implimented:
--  resizing floating windows from any corner
-- http://hackage.haskell.org/packages/archive/xmonad-contrib/0.8/doc/html/XMonad-Actions-FlexibleResize.html
--
-- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-FlexibleResize.html
-- wanna get a collumnular wmii-like layout
-- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-LayoutCombinators.html
-- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-Combo.html 
-- split frame, to add subsequent window from stack, so that frame contains two frames, split on the opposite axis to normal in that pane.  thus http://ompldr.org/vNmJmag/nextthingiwantinxmonad.gif  -- i should probably expand on that, to illustrate hoe the stack numbering cycles down seamlessly into splits, and out again to continue into rest of stack... so as in that image grey is 1, red 2, green 3, blue 4 and yellow 5, and a new window (6) created would add bellow the split frame, squidging the rest up...   i'll get around to getting this sorted out in this config at some point.  it's the next major thing it needs.  ^_^   of course it will have a split and desplit hotkeys too.  

-- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-LayoutScreens.html or perhaps even http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-CopyWindow.html or even simply http://lambda-haskell.galois.com/haskellwiki/Xmonad/General_xmonad.hs_config_tips#Ignoring_a_client_.28or_having_it_sticky.29
-- for a simpler more noobfriendly potential in window navigation: http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-WindowNavigation.html
-- MAKE NEWLY MADE FLOATING DIALOGUE WINDOWS BE ON TOP, ABOVE ALL OTHER FLOATING WINDOWS!   GURR!
-- double click border between windows to revert to "ratio" ("    ratio   = 1/2" --default).
-- resizeable grid?
-- config switcher for multi mode use... including, the long dessired (and procrastinated on) one handed xmonad config!   fully mouse controlled! it can be done... go find that thing that lets you map keys to mouse buttons, so u can have the modkey be the forward side mouse button.  how cool would that be!
-- normalBorderColor :: 
-- focusedBorderColor :: 

-- add another toggle-able mode, where xcompmgr is integrated with the stack / recancy (recentcy?) of a window's focus.  trailing in some algorythmic increments, so focused windo with most opaque, down to least opaque, at whatever the algoyrhm determins is apropriate for how many windows are present, likely down to 50% minimum or something.
-- -- configurable to even kill windows that are not looked at for so long (/so many new window creations), to kill at certain transparency, or limit max number of apps open... this is like doing for closing windows, what tiling window management did for moving and arranging windows for visibility, it automates it.  -- could likely also add ignoreAutoKill to prevent certain apps from being killed.


-- may want to encorporate:
-- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-GridSelect.html

-- DEFAULT TEMPATE :   http://haskell.org/haskellwiki/Xmonad/Config_archive/Template_xmonad.hs_%280.9%29
        
myManageHook = composeAll
    [ className =? "Gimp"      --> doFloat
--    , className =? "Gimp"      --> doIgnore
--    , className =? "pidgin"    --> doFloat
--    , className =? "Pidgin"    --> doFloat
--    , className =? "Skype"     --> doFloat
--    , className =? "skype"     --> doFloat
--    , className =? "vlc"       --> doFloat
--    , className =? "Vlc"       --> doFloat
--    , className =? "tilda"     --> doFloat
    , className =? "Tilda"     --> doFloat
    , className =? "Vncviewer" --> doFloat
    , className =? "gpicview" --> doFloat
    , className =? "Gpicview" --> doFloat
    , className =? "BetterPrivacy" --> doFloat
--    , className =? "file-roller"     --> doFloat
--    , className =? "File-roller"     --> doFloat
    , className =? "Extract"     --> doFloat
    ]

main = do
    xmproc <- spawnPipe "/usr/bin/tint2 /home/digit/.config/tint2/tint2rc"
    xmonad $ ewmh desktopConfig
        { manageHook = manageDocks <+> myManageHook -- make sure to include myManageHook definition from above
                        <+> manageHook desktopConfig
        , layoutHook = avoidStruts  $  layoutHook defaultConfig { layoutHook = myLayout } --see "myLayout" bellow
        , startupHook = spawn "starterscripts"
        , modMask = mod4Mask     -- Rebind Mod to the Windows key, consider xK_asciitilde perhaps?
        } `additionalKeys`
        [ ((0, xK_Menu), spawn "8menu")
        , ((mod4Mask, xK_F2), spawn "gmrun")
        , ((mod4Mask .|. shiftMask, xK_F2), spawn "gedit ~/.gmrunrc")
--        , ((mod4Mask, xK_F3), spawn "~/.config/dmenu/dmenu-bind.sh") --dmenu normal
        , ((mod4Mask, xK_F3), spawn "fdmenu") -- script with just "dmenu_path && ~/.config/dmenu/dmenu-bind.sh"
        , ((mod1Mask, xK_F3), spawn "~/.config/dmenu/dmenu-bindv.sh") -- vertical patch dmenu
        , ((mod4Mask .|. shiftMask, xK_F3), spawn "gedit ~/.config/dmenu/dmenu-bind.sh") -- edit dmenu
        , ((mod1Mask .|. shiftMask, xK_F3), spawn "gedit ~/.config/dmenu/dmenu-bindv.sh") -- edit dmenu vertical
        , ((mod4Mask, xK_F4), kill) -- close focused window
--        , ((mod1Mask, xK_F4), kill) -- oldskool close focused window
        , ((mod4Mask, xK_F5), spawn "xfce4-appfinder")
        , ((mod4Mask, xK_F6), spawn "xkill")
        , ((mod4Mask, xK_a), spawn "audacity")
--        , ((mod4Mask, xK_b), spawn "icecat")
        , ((mod4Mask, xK_b), spawn "uzbl-browser")
        , ((mod4Mask .|. mod1Mask, xK_b), spawn "seamonkey")
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_b), spawn "firefox-bin")
        , ((mod4Mask, xK_c), spawn "pidgin & skype")
        , ((mod4Mask, xK_d), spawn "gedit")
        , ((mod4Mask .|. controlMask, xK_d), spawn "gksudo gedit")
        , ((mod4Mask, xK_f), spawn "pcmanfm")
        , ((mod4Mask .|. controlMask, xK_f), spawn "gksudo pcmanfm")
        , ((mod4Mask .|. shiftMask, xK_f), spawn "searchmonkey")
        , ((mod4Mask .|. shiftMask .|. mod1Mask, xK_f), spawn "catfish")
        , ((mod4Mask, xK_g), spawn "gimp")
        , ((mod4Mask, xK_i), spawn "inkscape")
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_l), spawn "lxappearance") -- change gtk theme n stuff
        , ((mod4Mask, xK_m), spawn "vlc")
        , ((mod4Mask .|. mod1Mask, xK_m), spawn "deadbeef")
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_m), spawn "gedit ~/.config/openbox/menu.xml") -- edit openbox menu
        , ((mod4Mask, xK_n), sendMessage ToggleStruts) -- toggle panel visability.
        , ((mod4Mask .|. mod1Mask, xK_n), spawn "pkill tint2 && tint2") -- restart panel.
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_n), spawn "gedit ~/.config/tint2/tint2rc") -- edit panel config
        , ((mod4Mask, xK_o), spawn "openbox --replace") -- switch to openbox
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_o), spawn "gedit ~/.config/openbox/rc.xml") -- edit openbox config
        , ((mod4Mask .|. mod1Mask, xK_p), spawn "gksudo gparted")
        , ((mod4Mask, xK_p), spawn "gksudo gtkpacman")
--        , ((mod4Mask, xK_q), spawn "xmonad --restart")
        , ((mod4Mask, xK_q), kill) -- neo school close focused window
        , ((mod4Mask .|. mod1Mask, xK_t), spawn "tilda") -- launch tilda
--        , ((mod4Mask, xK_u), sendMessage ToggleStruts U) -- toggle panel visability.
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_x), spawn "gedit ~/.config/uzbl/config") -- edit uzbl main config
        , ((mod4Mask, xK_v), spawn "VirtualBox")
        , ((mod4Mask, xK_x), spawn "xmonad --recompile") -- recompile xmonad
        , ((mod4Mask .|. mod1Mask, xK_x), spawn "xmonad --restart") -- restart xmonad
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_x), spawn "gedit ~/.xmonad/xmonad.hs") -- edit xmonad config
        , ((mod4Mask, xK_y), spawn "conky")
        , ((mod4Mask .|. mod1Mask, xK_y), spawn "pkill conky && conky") --restart conky
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_y), spawn "gedit ~/.conkyrc") --edit conky
        , ((0, xK_Print), spawn "scrot '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/images/screenshots/ &amp; gpicview ~/images/screenshots/$f'")
        , ((mod1Mask, xK_Print), spawn "scrot -d 3 '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/images/screenshots/ &amp; gpicview ~/images/screenshots/$f'")
-- Digit's more window management keybinds
--        , ((modMask,               next),   nextWS)
--        , ((modMask,               prev),   prevWS)
        , ((mod4Mask, xK_Left), prevWS)
        , ((mod4Mask, xK_Right), nextWS)
--        , ((mod4Mask .|. mod1Mask, xK_Left), prevWS)
--        , ((mod4Mask .|. mod1Mask, xK_Right), nextWS)
--        , ((mod1Mask .|. controlMask .|. shiftMask, xK_Left), shiftToPrev)
--        , ((mod1Mask .|. controlMask .|. shiftMask, xK_Right), shiftToNext)
        , ((mod4Mask .|. shiftMask, xK_Left), shiftToPrev)
        , ((mod4Mask .|. shiftMask, xK_Right), shiftToNext)
-- 
        , ((mod4Mask .|. mod1Mask, xK_j), sendMessage ShrinkSlave) -- %! Shrink a slave area 
        , ((mod4Mask .|. mod1Mask, xK_k), sendMessage ExpandSlave) -- %! Expand a slave area
--        , ((mod4Mask .|. shiftMask, xK_h), sendMessage ShrinkSlave) -- %! Shrink a slave area 
--        , ((mod4Mask .|. shiftMask, xK_l), sendMessage ExpandSlave) -- %! Expand a slave area
-- Digit's layout.mosaic window management keybinds
        , ((mod4Mask .|. mod1Mask, xK_h), sendMessage Taller)
        , ((mod4Mask .|. mod1Mask, xK_l), sendMessage Wider)

        , ((mod4Mask .|. mod1Mask, xK_o), sendMessage Reset)
-- Digit's layout.mosaicalt window management keybinds
        , ((mod4Mask .|. shiftMask, xK_a), withFocused (sendMessage . expandWindowAlt))
        , ((mod4Mask .|. shiftMask, xK_z), withFocused (sendMessage . shrinkWindowAlt))
        , ((mod4Mask .|. shiftMask, xK_s), withFocused (sendMessage . tallWindowAlt))
        , ((mod4Mask .|. shiftMask, xK_d), withFocused (sendMessage . wideWindowAlt))
        , ((mod4Mask .|. controlMask, xK_space), sendMessage resetAlt)

-- Digit's Keybindings for window transparency
        , ((mod4Mask .|. mod1Mask, xK_1), spawn "transset-df 0.1")
        , ((mod4Mask .|. mod1Mask, xK_2), spawn "transset-df 0.2")
        , ((mod4Mask .|. mod1Mask, xK_3), spawn "transset-df 0.3")
        , ((mod4Mask .|. mod1Mask, xK_4), spawn "transset-df 0.4")
        , ((mod4Mask .|. mod1Mask, xK_5), spawn "transset-df 0.5")
        , ((mod4Mask .|. mod1Mask, xK_6), spawn "transset-df 0.6")
        , ((mod4Mask .|. mod1Mask, xK_7), spawn "transset-df 0.7")
        , ((mod4Mask .|. mod1Mask, xK_8), spawn "transset-df 0.8")
        , ((mod4Mask .|. mod1Mask, xK_9), spawn "transset-df 0.9")
        , ((mod4Mask .|. mod1Mask, xK_0), spawn "transset-df 1.0")
--        , ((mod4Mask .|. mod1Mask, xK_-), spawn "COMPOFF")
--        , ((mod4Mask .|. mod1Mask, xK_+), spawn "COMPON")
        , ((mod4Mask .|. mod1Mask, xK_minus), spawn "COMP -q") --smarter way to quit xcompmg
        , ((mod4Mask .|. mod1Mask, xK_equal), spawn "COMP -s") --smarter way to start xcompmg
--        , ((mod4Mask .|. mod1Mask, xK_asciitilde), spawn "xcompmgr -n -I-.015 -O-.03 -D9 -t-0 -l-0 &") --simpler way to start xcompmgr
        , ((mod4Mask .|. mod1Mask, xK_agrave), spawn "xCOMP") --simpler way to start xcompmgr, with a script containing the above simple way.
--        , ((mod4Mask .|. mod1Mask, xK_asciitilde), spawn "xCOMP") --simpler way to start xcompmgr, with a script containing the above simple way.
--        , ((mod4Mask .|. mod1Mask, xK_asciitilde), spawn "xCOMP") --simpler way to start xcompmgr, with a script containing the above simple way.
        ]

--myLayout
myLayout = ThreeCol 1 (2/100) (1/2) ||| ThreeColMid 1 (2/100) (7/11) ||| mosaic 2 [3,2] ||| MosaicAlt M.empty ||| withIM (1%7) (Role "buddy_list") Grid ||| mouseResizableTile ||| mouseResizableTileMirrored ||| withIM (1%7) (Role "buddy_list") simpleTabbed ||| noBorders Full
-- add in -- ||| spiral (1/7) ||| --with layout.spiral of course.
  where
    -- default tiling algorithm partitions the screen into two panes
--    tiled   = Tall nmaster delta ratio --need to figure out how to correctly impliment this line, if i want to adjust the nmaster, ratio and delta....  and i do very much want to adjust the delta.  .. but its not essential, now that i have mouse resize
 
    -- The default number of windows in the master pane
    nmaster = 1
 
    -- Default proportion of screen occupied by master pane
    ratio   = 1/2
 
    -- Percent of screen to increment by when resizing panes
    delta   = 2/100
-- 

Last edited by Digit (2011-10-24 12:33:21)

Offline

#11 2011-10-24 16:03:15

h8uthemost
#! Junkie
Registered: 2011-08-09
Posts: 296

Re: My Xmonad Adventures

I went to install this just to give it a try, and apt-get is telling me that all together the install size will be about 430MB. hmm

Is it just me or did everyone else encounter this install size? Seems incredibly large to me for a tiling WM. I think I remember my Awesome install wasn't close to being that large and that WM is basically a desktop.


We are a nice, friendly community here and I hope we stay that way.

Offline

#12 2011-10-24 17:25:47

Digit
#! Die Hard
From: the internet
Registered: 2009-05-26
Posts: 1,025
Website

Re: My Xmonad Adventures

yeah, that's haskell n other gubbins that take up so much space.

xmonad itself is ridiculously tiny (comparable to dwm).

debian's way of pulling in loads, makes sure you get everything you need, but that also means it's gonna be big.

i remember when i installed it on crunchbang last, i wanted a load of other stuff too, and it ended up over a gig!

i'm pretty sure i've always managed to keep it waaaaay smaller than even that 430 in gentoo.

Offline

#13 2011-10-24 17:28:10

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: My Xmonad Adventures

h8uthemost wrote:

Is it just me or did everyone else encounter this install size? Seems incredibly large to me for a tiling WM. I think I remember my Awesome install wasn't close to being that large and that WM is basically a desktop.

It needs to import all the Haskell libraries, which is kinda like importing a whole new OS.

Offline

#14 2011-10-24 23:33:05

Digit
#! Die Hard
From: the internet
Registered: 2009-05-26
Posts: 1,025
Website

Re: My Xmonad Adventures

if the haskell deps are too much for you, there's always scrotwm.

but then, you're missing out on the real awesome potential of xmonad. 

it is said that xmonad is not just a window manager, but a library from which to construct your own wm.

though if you dont care about configurability, maybe even scrotwm is too configurable for you, and you might as well go with dwm.


[edit, lol, sorry... did that sound snippy?]  XD

Last edited by Digit (2011-10-24 23:33:57)

Offline

#15 2011-10-25 00:21:14

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: My Xmonad Adventures

Digit wrote:

it is said that xmonad is not just a window manager, but a library from which to construct your own wm.

Your own world! Where you don't understand anybody!

Offline

#16 2011-10-25 09:18:32

h8uthemost
#! Junkie
Registered: 2011-08-09
Posts: 296

Re: My Xmonad Adventures

I've already been using Scrotwm. In fact it's pretty much became my default wm. But I've been reading up Xmonad and it sounds pretty interesting. I was just wondering if I was alone in this huge download size for a tiling wm. I thought that was crazy. But it sounds like it's the norm.

I'll give it a try and see how it goes. I've been looking for something along the lines of Scrotwm but with a native status tray. And judging from the posts above you can use tint2 with this tiler, so xmonad may be just what I've been looking for.


We are a nice, friendly community here and I hope we stay that way.

Offline

#17 2011-10-25 10:59:41

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 3,010

Re: My Xmonad Adventures

el_koraco wrote:
Digit wrote:

it is said that xmonad is not just a window manager, but a library from which to construct your own wm.

Your own world! Where you don't understand anybody!

Australia?


Point & Squirt

Offline

#18 2011-10-25 16:12:51

h8uthemost
#! Junkie
Registered: 2011-08-09
Posts: 296

Re: My Xmonad Adventures

EDIT: Nevermind

Last edited by h8uthemost (2011-10-25 19:31:22)


We are a nice, friendly community here and I hope we stay that way.

Offline

#19 2011-11-03 04:34:39

rubic
New Member
Registered: 2011-11-03
Posts: 3

Re: My Xmonad Adventures

Just installed CrunchBang on an old laptop yesterday.  I'm running xmonad under gnome & xcfe4 on other machines, so it's great to see other people here running it on #!.

One thing I'm curious about.  Are most of you running xmonad under xcfe4, or are you going "full monty", i.e. pure xmonad?

Offline

#20 2011-11-08 02:12:32

rubic
New Member
Registered: 2011-11-03
Posts: 3

Re: My Xmonad Adventures

In trying to keep my xmonad environment capable with other CrunchBang WMs, here's what I came up with.

1. 

sudo cp -p /usr/bin/startxfce4 /usr/local/bin/startxmonad

2.  Edit /usr/local/bin/startxmonad and replace all occurrences of 'xfce4' with 'xmonad'.

sudo sed -i 's/xfce4/xmonad/g' /usr/local/bin/startxmonad

3.  Edit /usr/share/xsessions/xmonad.desktop and replace 'xmonad' in Exec:

    < Exec=xmonad
    > Exec=/usr/local/bin/startxmonad

4. 

mkdir ~/.config/xmonad ; touch ~/.config/xmonad/xinitrc ; chmod a+x ~/.config/xmonad/xinitrc

5.  My skeletal ~/.config/xmonad/xinitrc contains:

xmonad
exit 0

Then season to taste.  If xinitrc is missing, then your xmonad configuration obviously won't boot, but now it's easier to put in xmonad autostart.sh stuff distinguished from other startup sessions.

Anybody have better hack?

Last edited by rubic (2011-11-08 02:14:12)

Offline

#21 2012-02-18 12:41:57

Digit
#! Die Hard
From: the internet
Registered: 2009-05-26
Posts: 1,025
Website

Re: My Xmonad Adventures

ack, yeah, thats kinda ugly.

idk what you rly need in terms of "keep my xmonad environment capable with other CrunchBang WMs".  normally i just install it, and it's good to go by selecting it from the session list on the login screen.

even when forgoing a login manager, only xmonad in xinitrc is all i'd need to do.

Offline

#22 2012-09-25 11:09:21

Digit
#! Die Hard
From: the internet
Registered: 2009-05-26
Posts: 1,025
Website

Re: My Xmonad Adventures

i've come back to xmonad.  i loved my time spent with scrotwm, clfswm, and i3 very much, but it seems only xmonad really has my heart.

yes, it's dependancies are huge, which completely nullifies it's great claim of being tiny footprint, but at least it does run like a dream.

i forgot how satisfying it is to configure.

import this, paste that, save, and press the keybind to refresh.  easy peasy.  heh, well, only sometimes is it that beautifully straight forward, but that just makes it sll the more satisfying when you do get something more complicated to work.

currently, i'm giving another look into layout combo.

specifically, i want to see if i can get each window/tile to behave like you have in clfswm, in that it can contain any layout and behave like it's the fullscreen root window full of it's layout... which most of all, i want so i can have tabs, in windows.  i've seen it done, i know it can be done, i just want to see if it can be done by me!  ^_^ 

i had my first rudimentary success getting the layout.combo example to work, and playing around with it, testing it's edges, seeing what i can get away with, and what i'd have to get more complex layout hooks for.  had some nice successes, and also some headaches.  this is my first time using xmonad 0.10 afaicr, so maybe there's some difference there... but didnt there used to be a "Tall" or a "tile" or "tiled" layout that was the standard layout, and mirror version for the h/v vice versa of it.... no?  well anyways, i had grid and simpleTabbed happily working, and Full, and was playing around with those in different combinations, with TwoPane... idk if it's TwoPane's fault, layout.combo or layout.windownavigation's fault, or specifically just my own pebkac not related to any of them...  but i could never get the second pane to really be controlled and manipulated, new windows would always go to the first, regardless of layouts or where was selected, and they couldnt be moved to the second, but it was still part of the stack, and so there was always a window there, just it only got there by dead man's boots, so to speak. 

so anyways, enough waffle,

suffice to say, it's early days yet, but just thought i'd update my little adventures with xmonad thread to signify my return.

i know xmonad's more than just a nice clean minimal tiling window manager, i know it's also a massive ever-growing extension library to make your own window manager. 

hats off to clfswm too, it's customiseability potential, from what i saw, rivals xmonad's.  or is certainly the closest i've seen since openbox.

i never got in very deep with i3, but i can see why so many love it.  i started to find it struggled under some of the heavy workloads i'd give it (as do all wm, but this more than most.), but it was, and still will be, a wm i enjoy using. 

both have been a bit of an inspiration.

i3's mouse resizeable tiles, and some other behaviours did slightly resemble my old xmonadconfig, before i went a bit crazy and added something like 9 layouts without setting jump to layout, just having them in a mono directional selection cycle, u had to go through each one to get back to one if you over shot.  XD  oh fail.   heh, i'd gotten too entrenched in it.  i'm somewhat tempted now to start managing my xmonad configs on github.  they're painfully noobish, but i should face the public scorn n take the more expedient path of learning, than remain a silent fool. wink  and of course it'd make branching them easier (so goes the theory), rather than trying to play with a dozen divergent ideas in a single creation.

===
edit woops, why did i hit submit, i'm still rambling n editing...
hold on...
===

so, layout combo, that's likely the main player in getting this clfswm/i3-esq tabbed panes +
...just that there's this little issue it seems to raise:

These bindings will move a window into the sublayout that is up/down/left/right of its current position. Note that there is some weirdness in combineTwo, in that the mod-tab focus order is not very closely related to the layout order. This is because we're forced to keep track of the window positions separately, and this is ugly. If you don't like this, lobby for hierarchical stacks in core xmonad or go reimplement the core of xmonad yourself.

troubling.

no hierarchical stacks...

maybe i'll find success with clever use of lists
and other haskellian geniusness, or find some other smart cookie already has the solutions in some other xmonad extension, ready for a noob like me to bumble along and clumsily figure out how to copy and paste correctly.  ^_^

anyway, i rly think that is enough waffle now.  more reading and sussing, less waffling.  ho!  ;D

Last edited by Digit (2012-09-25 11:20:00)

Offline

#23 2012-09-26 14:20:58

Digit
#! Die Hard
From: the internet
Registered: 2009-05-26
Posts: 1,025
Website

Re: My Xmonad Adventures

sublayouts.

luscious, gorgeous sublayouts.

i'd been looking around for this sort of thing for a while... and now i've found it (and learned a lot about other layouts, layout combinators and other extensions in the process of looking).

i've only got this working to a rudimentary level, but i'll post it as-is in the shabby xmonad.hs it's in.  be warned, i've been churning through making configs at lightning pace, so, it's no-doubt a bit disjointed, unused modules, broken comments, and not to mention all my half-ass crap i've commented out... and like i say, only just got it on the go.  rudimentary as a rock tool.  no doubt in need of keybind re-arranging cleanup too... ooh, which reminds me, this xmonad.hs has me also implementing two things i've wanted to do for a while too, emacs-like keybinds (and cleaner shorter code for them too, amen), and WSAD controls and cursor controls.   again, i stress, there'll be many kinks, kludges n borks.  there, with all that caveat'ing and warning done, without further ado:

import XMonad  hiding ( (|||) )
import XMonad.Layout.LayoutCombinators -- hiding ( (|||) )
import XMonad.Util.EZConfig -- allows all kinds, like automated emacs submaps 
import XMonad.Actions.Submap -- allows emacs-like keys
import XMonad.Layout.Tabbed
import XMonad.Layout.Groups.Wmii
import qualified XMonad.StackSet as W
import XMonad.Actions.CycleWS

--sublayoutstuff http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-SubLayouts.html
import XMonad.Layout.SubLayouts
import XMonad.Layout.WindowNavigation
import XMonad.Layout.BoringWindows


main = xmonad $ defaultConfig
     { modMask = mod4Mask -- use tux instead of alt, which is M1
     , terminal = "xterm"
     , normalBorderColor  = "#487855" --487855 mk1 of "inteligent green"
     , focusedBorderColor = "#ff6900"
     , keys = djtemacsKeys
     , layoutHook = djtslayoutHook
     --, workspaces = djtWorktops               
     } -- `additionalKeysP` djtemacsKeys

djtslayoutHook = windowNavigation $ subTabbed $ boringWindows $
                 simpleTabbed ||| (Tall 1 (3/100) (1/2) *//* Full)  ||| (Tall 1 (3/100) (1/2) ***||** Full) ||| Full ||| wmii shrinkText defaultTheme

--djtWorktops = ["dmp", "stf","web", "irc", "gmp", "wrk", "sys", "mov", "msc"] ++ map show ["1","2","3","4","5","6","7",","9","0"]
--djtWorktops = [1..9]
djtWorktops  = ["1","2","3","4","5","6","7","8","9"]

djtemacsKeys = \c -> mkKeymap c $
     [ ("M-S-<Return>", spawn $ terminal c)
     , ("M-x o", spawn "xteddy")  -- type mod+x then w to pop up 'woohoo!'
     , ("M-S-c", kill)
     , ("M-<F6>", spawn "xkill")
     , ("M-q", spawn "xmonad --recompile && xmonad --restart")
--     , ("M-f2", spawn "dmenu-bind.sh")  
--     , ("M-F2", spawn "dmenu-bind.sh")  
     , ("M-s", spawn "dmenu-bind.sh")  
     , ("M-<F2>", spawn "dmenu-bind.sh")       
     , ("<Menu>", spawn "8menu")
     , ("M-<Menu>", spawn "dmenu-bind.sh")
     , ("M-<Space>", sendMessage NextLayout)
     , ("M-y u",  sendMessage $ JumpToLayout "Full")  -- jump directly to the Full layout
     , ("M-y i",  sendMessage $ JumpToLayout "Tabbbed Simplest")  -- jump directly to the simpleTabbed Layout
     , ("M-y o",  sendMessage $ JumpToLayout "Tall")  -- jump directly to the Tall layout
       -- here are the wmii-style  keybinds
    -- , ("M-y h", groupToProviousLayout) -- i wish
     , ("M-y w j", zoomGroupIn) 
     , ("M-y w k", zoomGroupOut) 
     , ("M-y w l", groupToNextLayout) 
     , ("M-y w q", zoomGroupReset) 
     , ("M-y w u", groupToFullLayout) 
     , ("M-y w i", groupToTabbedLayout) 
     , ("M-y w o", groupToVerticalLayout)      
     , ("M-y w t", toggleGroupFull)  
--     , ("M-1",  )  -- was thinking i have to re-write my workspace and layout navigation keys it seems. 
       --gamer controls w,s,a,d.  also suited for other ~one hand on keyboard, one hand on mouse~ type applications, suchas gimp or blender or audacity, etc.
     , ("M-w", windows W.focusDown)
     , ("M-a", sendMessage Shrink)
     , ("M-s", windows W.focusDown)
     , ("M-d", sendMessage Expand)     
     , ("M-C-a", sendMessage $ pullGroup L) --sublayout
     , ("M-C-d", sendMessage $ pullGroup R) --sublayout
     , ("M-C-w", sendMessage $ pullGroup U) --sublayout
     , ("M-C-s", sendMessage $ pullGroup D) --sublayout
     , ("<XF86Back>", sendMessage (IncMasterN (-1)))
     , ("<XF86Forward>", sendMessage (IncMasterN (1)))
     , ("M-<XF86Back>", prevWS)
     , ("M-<XF86Forward>", nextWS)
     , ("S-M-<XF86Back>", shiftToPrev)
     , ("S-M-<XF86Forward>", shiftToNext)
     , ("M-<Down>", windows W.focusDown)
     , ("M-<Up", windows W.focusUp)
     , ("S-M-<Down>", windows W.swapDown)
     , ("S-M-<Up", windows W.swapUp)
     , ("M-C-h", sendMessage $ pullGroup L) --sublayout
     , ("M-C-l", sendMessage $ pullGroup R) --sublayout
     , ("M-C-k", sendMessage $ pullGroup U) --sublayout
     , ("M-C-j", sendMessage $ pullGroup D) --sublayout

     , ("M-C-m", withFocused (sendMessage . MergeAll)) --sublayout
     , ("M-C-u", withFocused (sendMessage . UnMerge)) --sublayout

     , ("M-C-<period>", onGroup W.focusUp') --sublayout
     , ("M-C-<comma>", onGroup W.focusDown') --sublayout
--     , ("M-j", focusDown) --sublayout boringwindow skips unactive sublayout windows
--     , ("M-k", focusUp) --sublayout boringwindow skips unactive sublayout windows
--     , ("M-"), submap $ defaultSublMap conf)    -- idk wtf to get this shit working right again in emacsian style
--     , ("M-S-" ++ [n] | n <- ['1'..'9'])
    -- mod-[1..9], Switch to workspace N
    -- mod-shift-[1..9], Move client to workspace N
    --
--     [((m "M" k), windows $ f i)
--        | (i, k) <- zip (XMonad.workspaces conf) ["1" .. "9"]
--        , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
--     ++

    --
    -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3
    -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3
    --
--     [((m "M", key), screenWorkspace sc >>= flip whenJust (windows . f))
--        | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
--        , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
     ]

oh, and another little cutie concept in the making, just jotted down for reference, not actually working code yet, but:

import XMonad
import XMonad.Layout.Tabbed
import XMonad.Layout.SubLayouts
import XMonad.Layout

conceptLayout = toplay ||| sublay
  where
    toplay = tiled ||| Mirror tiled ||| Full
      where tiled   = Tall nmaster delta ratio
            nmaster = 1     
            ratio   = 1/2    
            delta   = 3/100
    sublay = Full ||| simpleTabbed ||| mosaic

then i'll add splitVerticalBy and splitHorrizontalBy keybinds and other stuff... but the jist of this little ditty is that you'd have both the standard default familiar layout modes, seemlessly as useable as default, but also have a second level of sublayouts that you can nest inside any of those windows in the toplayout.  the sublayouts are always there, but since their first default layout is full, you are unlikely to notice any difference.  clever eh?  havnt quite got it mapped out in my mind how i'd keybind it all to be clean and intuitive, but i think there's plenty room.  smile

ahhh, it's good to be back playing with xmonad.  it really is so satasfying.  smile smile  you just dont really get to do this stuff with other wm, at least not that i've seen.

Offline

#24 2012-12-04 10:09:44

Digit
#! Die Hard
From: the internet
Registered: 2009-05-26
Posts: 1,025
Website

Re: My Xmonad Adventures

WARNING: This post may contain over-excited manic ecstatic geegasmic ramblings in parts, at length.  ;D

[Edit]Alternative short version of the story, ( SPOILER ALERT ): sharing latest config, it's messy still, see second code paste bellow for xmonad.hs with f11,tab,grid,onebig,omnibind. fin. [/edit]

a quick glance at my last post there... heh, it never goes according to plan... the plan always evolves and moves onward too.   infact... thinking back...  way back...

Digit wrote:

~ ~ ~ ~ ~ ~ ~ wibbly foggy harp-jingle'd flashback quote ~ ~ ~ ~ ~ ~ ~
my workstation's current config has bloated up as i've been trying out various new layouts... so many layouts, and only using a cycle-through-layouts.... this isnt quite as useful any more.  ... i really should have bit the bullet n gone n sussed out integrating layout combo / combinators by now.  but just so i can have a laugh at this looking back from some time in the future once i get it cleaned up, here it is:

import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Hooks.EwmhDesktops
import XMonad.Config.Desktop
import XMonad.Actions.CycleWS
import XMonad.Layout.MouseResizableTile --and shrink/expand slave layout
import XMonad.Layout.Tabbed -- handy for uzbl
import XMonad.Layout.NoBorders
import XMonad.Layout.Grid
import XMonad.Layout.Combo
--import XMonad.Layout.LayoutCombinators hiding --( (|||) )
--import XMonad.Layout.Spiral
import XMonad.Layout.IM
import XMonad.Layout.Mosaic
import XMonad.Layout.MosaicAlt
import qualified Data.Map as M
import XMonad.Layout.ThreeColumns
import Data.Ratio ((%))
import System.IO

-- initially created with help of: http://www.haskell.org/haskellwiki/Xmonad/Config_archive/John_Goerzen%27s_Configuration
-- use "xmonad --recompile" to check it's syntactically correct if making changes (better than just modQ)
    -- list of key codes http://haskell.org/haskellwiki/Xmonad/Key_codes
    -- may also prove useful for some keys and commands http://hackage.haskell.org/packages/archive/X11/1.4.5/doc/html/Graphics-X11-Types.html
    -- many useful tips and tricks https://bbs.archlinux.org/viewtopic.php?id=40636
    -- 0.9 contrib, v.handy list of extensions http://xmonad.org/xmonad-docs/xmonad-contrib/index.html


-- also used 
-- no border fullscreen. http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-NoBorders.html
-- http://hackage.haskell.org/packages/archive/xmonad-contrib/0.8/doc/html/XMonad-Doc-Extending#Editing_mouse_bindings.html
-- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-MouseResizableTile.html
---- still need to learn how to change the size of the border gap between tiles now that a 6pixel gap has been adeed.  :/


-- yet to be implimented:
--  resizing floating windows from any corner
-- http://hackage.haskell.org/packages/archive/xmonad-contrib/0.8/doc/html/XMonad-Actions-FlexibleResize.html
--
-- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-FlexibleResize.html
-- wanna get a collumnular wmii-like layout
-- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-LayoutCombinators.html
-- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-Combo.html 
-- split frame, to add subsequent window from stack, so that frame contains two frames, split on the opposite axis to normal in that pane.  thus http://ompldr.org/vNmJmag/nextthingiwantinxmonad.gif  -- i should probably expand on that, to illustrate hoe the stack numbering cycles down seamlessly into splits, and out again to continue into rest of stack... so as in that image grey is 1, red 2, green 3, blue 4 and yellow 5, and a new window (6) created would add bellow the split frame, squidging the rest up...   i'll get around to getting this sorted out in this config at some point.  it's the next major thing it needs.  ^_^   of course it will have a split and desplit hotkeys too.  

-- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-LayoutScreens.html or perhaps even http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-CopyWindow.html or even simply http://lambda-haskell.galois.com/haskellwiki/Xmonad/General_xmonad.hs_config_tips#Ignoring_a_client_.28or_having_it_sticky.29
-- for a simpler more noobfriendly potential in window navigation: http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-WindowNavigation.html
-- MAKE NEWLY MADE FLOATING DIALOGUE WINDOWS BE ON TOP, ABOVE ALL OTHER FLOATING WINDOWS!   GURR!
-- double click border between windows to revert to "ratio" ("    ratio   = 1/2" --default).
-- resizeable grid?
-- config switcher for multi mode use... including, the long dessired (and procrastinated on) one handed xmonad config!   fully mouse controlled! it can be done... go find that thing that lets you map keys to mouse buttons, so u can have the modkey be the forward side mouse button.  how cool would that be!
-- normalBorderColor :: 
-- focusedBorderColor :: 

-- add another toggle-able mode, where xcompmgr is integrated with the stack / recancy (recentcy?) of a window's focus.  trailing in some algorythmic increments, so focused windo with most opaque, down to least opaque, at whatever the algoyrhm determins is apropriate for how many windows are present, likely down to 50% minimum or something.
-- -- configurable to even kill windows that are not looked at for so long (/so many new window creations), to kill at certain transparency, or limit max number of apps open... this is like doing for closing windows, what tiling window management did for moving and arranging windows for visibility, it automates it.  -- could likely also add ignoreAutoKill to prevent certain apps from being killed.


-- may want to encorporate:
-- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-GridSelect.html

-- DEFAULT TEMPATE :   http://haskell.org/haskellwiki/Xmonad/Config_archive/Template_xmonad.hs_%280.9%29
        
myManageHook = composeAll
    [ className =? "Gimp"      --> doFloat
--    , className =? "Gimp"      --> doIgnore
--    , className =? "pidgin"    --> doFloat
--    , className =? "Pidgin"    --> doFloat
--    , className =? "Skype"     --> doFloat
--    , className =? "skype"     --> doFloat
--    , className =? "vlc"       --> doFloat
--    , className =? "Vlc"       --> doFloat
--    , className =? "tilda"     --> doFloat
    , className =? "Tilda"     --> doFloat
    , className =? "Vncviewer" --> doFloat
    , className =? "gpicview" --> doFloat
    , className =? "Gpicview" --> doFloat
    , className =? "BetterPrivacy" --> doFloat
--    , className =? "file-roller"     --> doFloat
--    , className =? "File-roller"     --> doFloat
    , className =? "Extract"     --> doFloat
    ]

main = do
    xmproc <- spawnPipe "/usr/bin/tint2 /home/digit/.config/tint2/tint2rc"
    xmonad $ ewmh desktopConfig
        { manageHook = manageDocks <+> myManageHook -- make sure to include myManageHook definition from above
                        <+> manageHook desktopConfig
        , layoutHook = avoidStruts  $  layoutHook defaultConfig { layoutHook = myLayout } --see "myLayout" bellow
        , startupHook = spawn "starterscripts"
        , modMask = mod4Mask     -- Rebind Mod to the Windows key, consider xK_asciitilde perhaps?
        } `additionalKeys`
        [ ((0, xK_Menu), spawn "8menu")
        , ((mod4Mask, xK_F2), spawn "gmrun")
        , ((mod4Mask .|. shiftMask, xK_F2), spawn "gedit ~/.gmrunrc")
--        , ((mod4Mask, xK_F3), spawn "~/.config/dmenu/dmenu-bind.sh") --dmenu normal
        , ((mod4Mask, xK_F3), spawn "fdmenu") -- script with just "dmenu_path && ~/.config/dmenu/dmenu-bind.sh"
        , ((mod1Mask, xK_F3), spawn "~/.config/dmenu/dmenu-bindv.sh") -- vertical patch dmenu
        , ((mod4Mask .|. shiftMask, xK_F3), spawn "gedit ~/.config/dmenu/dmenu-bind.sh") -- edit dmenu
        , ((mod1Mask .|. shiftMask, xK_F3), spawn "gedit ~/.config/dmenu/dmenu-bindv.sh") -- edit dmenu vertical
        , ((mod4Mask, xK_F4), kill) -- close focused window
--        , ((mod1Mask, xK_F4), kill) -- oldskool close focused window
        , ((mod4Mask, xK_F5), spawn "xfce4-appfinder")
        , ((mod4Mask, xK_F6), spawn "xkill")
        , ((mod4Mask, xK_a), spawn "audacity")
--        , ((mod4Mask, xK_b), spawn "icecat")
        , ((mod4Mask, xK_b), spawn "uzbl-browser")
        , ((mod4Mask .|. mod1Mask, xK_b), spawn "seamonkey")
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_b), spawn "firefox-bin")
        , ((mod4Mask, xK_c), spawn "pidgin & skype")
        , ((mod4Mask, xK_d), spawn "gedit")
        , ((mod4Mask .|. controlMask, xK_d), spawn "gksudo gedit")
        , ((mod4Mask, xK_f), spawn "pcmanfm")
        , ((mod4Mask .|. controlMask, xK_f), spawn "gksudo pcmanfm")
        , ((mod4Mask .|. shiftMask, xK_f), spawn "searchmonkey")
        , ((mod4Mask .|. shiftMask .|. mod1Mask, xK_f), spawn "catfish")
        , ((mod4Mask, xK_g), spawn "gimp")
        , ((mod4Mask, xK_i), spawn "inkscape")
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_l), spawn "lxappearance") -- change gtk theme n stuff
        , ((mod4Mask, xK_m), spawn "vlc")
        , ((mod4Mask .|. mod1Mask, xK_m), spawn "deadbeef")
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_m), spawn "gedit ~/.config/openbox/menu.xml") -- edit openbox menu
        , ((mod4Mask, xK_n), sendMessage ToggleStruts) -- toggle panel visability.
        , ((mod4Mask .|. mod1Mask, xK_n), spawn "pkill tint2 && tint2") -- restart panel.
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_n), spawn "gedit ~/.config/tint2/tint2rc") -- edit panel config
        , ((mod4Mask, xK_o), spawn "openbox --replace") -- switch to openbox
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_o), spawn "gedit ~/.config/openbox/rc.xml") -- edit openbox config
        , ((mod4Mask .|. mod1Mask, xK_p), spawn "gksudo gparted")
        , ((mod4Mask, xK_p), spawn "gksudo gtkpacman")
--        , ((mod4Mask, xK_q), spawn "xmonad --restart")
        , ((mod4Mask, xK_q), kill) -- neo school close focused window
        , ((mod4Mask .|. mod1Mask, xK_t), spawn "tilda") -- launch tilda
--        , ((mod4Mask, xK_u), sendMessage ToggleStruts U) -- toggle panel visability.
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_x), spawn "gedit ~/.config/uzbl/config") -- edit uzbl main config
        , ((mod4Mask, xK_v), spawn "VirtualBox")
        , ((mod4Mask, xK_x), spawn "xmonad --recompile") -- recompile xmonad
        , ((mod4Mask .|. mod1Mask, xK_x), spawn "xmonad --restart") -- restart xmonad
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_x), spawn "gedit ~/.xmonad/xmonad.hs") -- edit xmonad config
        , ((mod4Mask, xK_y), spawn "conky")
        , ((mod4Mask .|. mod1Mask, xK_y), spawn "pkill conky && conky") --restart conky
        , ((mod4Mask .|. controlMask .|. mod1Mask, xK_y), spawn "gedit ~/.conkyrc") --edit conky
        , ((0, xK_Print), spawn "scrot '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/images/screenshots/ &amp; gpicview ~/images/screenshots/$f'")
        , ((mod1Mask, xK_Print), spawn "scrot -d 3 '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/images/screenshots/ &amp; gpicview ~/images/screenshots/$f'")
-- Digit's more window management keybinds
--        , ((modMask,               next),   nextWS)
--        , ((modMask,               prev),   prevWS)
        , ((mod4Mask, xK_Left), prevWS)
        , ((mod4Mask, xK_Right), nextWS)
--        , ((mod4Mask .|. mod1Mask, xK_Left), prevWS)
--        , ((mod4Mask .|. mod1Mask, xK_Right), nextWS)
--        , ((mod1Mask .|. controlMask .|. shiftMask, xK_Left), shiftToPrev)
--        , ((mod1Mask .|. controlMask .|. shiftMask, xK_Right), shiftToNext)
        , ((mod4Mask .|. shiftMask, xK_Left), shiftToPrev)
        , ((mod4Mask .|. shiftMask, xK_Right), shiftToNext)
-- 
        , ((mod4Mask .|. mod1Mask, xK_j), sendMessage ShrinkSlave) -- %! Shrink a slave area 
        , ((mod4Mask .|. mod1Mask, xK_k), sendMessage ExpandSlave) -- %! Expand a slave area
--        , ((mod4Mask .|. shiftMask, xK_h), sendMessage ShrinkSlave) -- %! Shrink a slave area 
--        , ((mod4Mask .|. shiftMask, xK_l), sendMessage ExpandSlave) -- %! Expand a slave area
-- Digit's layout.mosaic window management keybinds
        , ((mod4Mask .|. mod1Mask, xK_h), sendMessage Taller)
        , ((mod4Mask .|. mod1Mask, xK_l), sendMessage Wider)

        , ((mod4Mask .|. mod1Mask, xK_o), sendMessage Reset)
-- Digit's layout.mosaicalt window management keybinds
        , ((mod4Mask .|. shiftMask, xK_a), withFocused (sendMessage . expandWindowAlt))
        , ((mod4Mask .|. shiftMask, xK_z), withFocused (sendMessage . shrinkWindowAlt))
        , ((mod4Mask .|. shiftMask, xK_s), withFocused (sendMessage . tallWindowAlt))
        , ((mod4Mask .|. shiftMask, xK_d), withFocused (sendMessage . wideWindowAlt))
        , ((mod4Mask .|. controlMask, xK_space), sendMessage resetAlt)

-- Digit's Keybindings for window transparency
        , ((mod4Mask .|. mod1Mask, xK_1), spawn "transset-df 0.1")
        , ((mod4Mask .|. mod1Mask, xK_2), spawn "transset-df 0.2")
        , ((mod4Mask .|. mod1Mask, xK_3), spawn "transset-df 0.3")
        , ((mod4Mask .|. mod1Mask, xK_4), spawn "transset-df 0.4")
        , ((mod4Mask .|. mod1Mask, xK_5), spawn "transset-df 0.5")
        , ((mod4Mask .|. mod1Mask, xK_6), spawn "transset-df 0.6")
        , ((mod4Mask .|. mod1Mask, xK_7), spawn "transset-df 0.7")
        , ((mod4Mask .|. mod1Mask, xK_8), spawn "transset-df 0.8")
        , ((mod4Mask .|. mod1Mask, xK_9), spawn "transset-df 0.9")
        , ((mod4Mask .|. mod1Mask, xK_0), spawn "transset-df 1.0")
--        , ((mod4Mask .|. mod1Mask, xK_-), spawn "COMPOFF")
--        , ((mod4Mask .|. mod1Mask, xK_+), spawn "COMPON")
        , ((mod4Mask .|. mod1Mask, xK_minus), spawn "COMP -q") --smarter way to quit xcompmg
        , ((mod4Mask .|. mod1Mask, xK_equal), spawn "COMP -s") --smarter way to start xcompmg
--        , ((mod4Mask .|. mod1Mask, xK_asciitilde), spawn "xcompmgr -n -I-.015 -O-.03 -D9 -t-0 -l-0 &") --simpler way to start xcompmgr
        , ((mod4Mask .|. mod1Mask, xK_agrave), spawn "xCOMP") --simpler way to start xcompmgr, with a script containing the above simple way.
--        , ((mod4Mask .|. mod1Mask, xK_asciitilde), spawn "xCOMP") --simpler way to start xcompmgr, with a script containing the above simple way.
--        , ((mod4Mask .|. mod1Mask, xK_asciitilde), spawn "xCOMP") --simpler way to start xcompmgr, with a script containing the above simple way.
        ]

--myLayout
myLayout = ThreeCol 1 (2/100) (1/2) ||| ThreeColMid 1 (2/100) (7/11) ||| mosaic 2 [3,2] ||| MosaicAlt M.empty ||| withIM (1%7) (Role "buddy_list") Grid ||| mouseResizableTile ||| mouseResizableTileMirrored ||| withIM (1%7) (Role "buddy_list") simpleTabbed ||| noBorders Full
-- add in -- ||| spiral (1/7) ||| --with layout.spiral of course.
  where
    -- default tiling algorithm partitions the screen into two panes
--    tiled   = Tall nmaster delta ratio --need to figure out how to correctly impliment this line, if i want to adjust the nmaster, ratio and delta....  and i do very much want to adjust the delta.  .. but its not essential, now that i have mouse resize
 
    -- The default number of windows in the master pane
    nmaster = 1
 
    -- Default proportion of screen occupied by master pane
    ratio   = 1/2
 
    -- Percent of screen to increment by when resizing panes
    delta   = 2/100
-- 

ha, hahahahaha.  B-}

yes, well, it's been a while since that one.

i've, just this last config tweek, got a nice mod+f11 to fullscreen any window any time i want.  so i've ditched my trailing " ||| Full" from my layouts, since it seems redundant and clumsy now. 

so, instead of that situation i was in before (in the flashback above), where i have a dozen layouts i can cycle through on mod+space, like awesome wm seems to think is awesome, which i, even at the time i had it, knew it was a ridiculous farce, now, even more so, since i have managed to truncate my layouts list back to something as short as default xmonad.

and i've managed to keep a lot more functionality now too.

i'm just chuffed i've come across that, and got it implemented, on my merry dance to hound down some more amazing layouts and try to find ways to implement some of the features i ramble about in my xmonad.hs's comments.

mod + f11

the perfect keybind, i thought.  :)  it's sane, logical, conventional, reasonable, unlikely to be in the way of anything else.  lovely.  bam.  fullscreen.  yes mamma!  ^_^

the xmonad.hs bellow does have a few other tricks up it's sleave too.  but again i warn, it's still a sloppy mess, i considered cleaning it up for presentability, and cleaning out the redundant stuff... but it kinda shows more of it's developmental heritage like this, in this snapshot.  i may have mentioned i was pursueing multiple config concept avenues at once, multiple family trees with unique starting points.  ...well...  yeah, eventually the one pair of configs that eventually got mingled and their concepts muddied, then went and merged with another, and then three others got bits of thrown into the mix too, and then i tried to splice them off into unique offshoots again, and that didnt get far but a handful of stumps, and then i really pushed for one, to become this clearer concept, just focussing on it, and then it ended up keeping loads of the ... yeah... so anyways...
it's more than just "yay i've got a fullscreen keybind", that was just the latest thing to make me smile n geekgasm over xmonad (and this config) about.  it's in the context of the other stuff that made that make me as gleeful as a tellytubby on coke.  it wasnt just mod+f11...   there's also...

tabbed sublayout.

merge windows in and out of tabbed sublayout in any direction.
--i liken this to moving windows in and out of floating, but just on the other side of tiling from floating, heh, if you catch my drift.

just TWO top level layouts.  Grid, and OneBig.  [edit]i RLY like onebig, esp in this config, esp with my switch to main keybind fixed, lol.  so many bugs must still persist[/edit]

the combination of ^ which, makes for an impressively flexible  and convenient window organisation and workflow.  esp now that i've ditched having the fullscreen view in the  layout cycle, which is no longer a cycle, but a straight back and forth toggle.  it almost seems strange now, having it on mod+space,  almost as if i should have that toggle between grid and onebig on something like mod+f12 or shift+mod+f11 or something.

oh, er, yeah, about the other keybinds, one (or three) of the ideas was to have emacs-like keybinds, windoze-convention-friendly keybinds, artist/gamer keybinds, and in the frankensteining genepool that became of my unmanaged organic code branches, there's bits of all that in there.  ^_^  so you can use wsad, hjkl, and cursor keys... er, i think.  that really wasnt the focus... but it evolved to support them all  (er, if it even does.. i think there's a few additions that didnt get translated to them all, i mostly use wsad..... er, and speaking of which, ctrl+mod+u for unmerging a window from the sublayout (tabbed) to the top level layout...  i've been thinking, should have a ctrl+mod+e too...  for the artist/gamer hands on mouse/keyboard geek-stance.  ^_^  *adds that before pasting (and adds a +shift version for the crazy merge-all that i never use)*

ok, way too much rambling, not enough pasting...


       
-- Hi, Welcome to Digit's Nice Minimal Tabular Boonad
-- clfswm/i3-ish combineable/tabable windows in frames, basic 1 level only (no full fs like in clfswm yet, sry)
-- 
-- a lil history
-- i've been making xmonad configs for a few years now.  used to be that i would just have the one, that i'd save periodic backups of as i worked on it over months, using it, refining the kinks, adding new features.  more recently, i've start to turn towards making some specific simpler xmonad configs.  sometimes the ideas get a little conflated and jumbled since i'm still new to organising multiple different development paths and goals at the same time, so the concept in this config might have become a little muggy in parts as the config got fleshed out.  i had used xmonad for a while before kde4 came out, both stand-alone, and in kde3.5, and standalone but with kde3.5's kickerbar, oh and various other ways, a wile with xmobar, and even some time with tint2, which was a fun challenge to get playing together nice.  i still like to surf other window managers from time to time.  and on fairly rare occassions, i'd sit down to dedicate trying out a wm for at least a fortnight, to give it a fair chance.  clfswm, was one wm i did this with.  i was already loosely planning on doing so, before i saw the videos of it in action.  well, suffice to say, it blew me away, and i had never expected another wm could ever have offered anything to rival xmonad.  i stuck with it, using it as my main wm for a few months.  a brief time of jumping between wm a little bit, and have spent a chunk of time with i3 now too.  wht impresed me most about clfswm, was it's advanced window management, that actually gave a bit of meaning to the "management" in that term we throw around.  the "file system"-like hierarchy of windows most notably, but also couple that with other features, and the way one sort of controls that third dimension of going into child windows, or moving back out to parents... genius.   and i3's lovely mergeable and tileable windows, very nicely done, and it shows those boys have been around the wmscape quite a bit.  each of these takes a little getting used to though of course, but the potential rewards are enormous.  and i'm a keen one for enormous rewards, even if it does take a bit of investment of time, research, salve and chin-rubbing.  like xmonad offers.  it's like the sorceror in a good classic rpg.  seemingly feeble to begin with, but as you build up, with enough xp n levels, you aquire the skills and potency to outshine any other would-be hero on the wmscape.  and with that, and knowing that xmonad is not just a wm, but a library for making your own wm from, i thought i'd try to implement some of those ideas i really liked from clfswm, and i3.
--
-- so this xmonad-based window manager [ ;) ] is a reimplementation of some clfswm & i3 ideas.
--
--status:
-- current state is fairly rudimentary, but fully useable for production.
-- still has initial birthing gunk on it.
-- could use more comments to help folks out, and less commented-out duff&guff.
--version:
-- xmonad.hs-DigitsNiceMinimalTabularBoonad-000
---- commented version number here changes when comments change when config is ace.

--pseudoplan:
-- expand beyond mere grid-only layout in top layer (was half-implemnted earlier, but had issues)
-- add more clfswm-like features
----like clone, fs-like window hierarchy, on-the-fly keybinds to workspaces
-- make it nice
-- make it so you can pick up a floating window full of tabs
-- make it so pidgin has a clfswm'like ability to have it's contacts and chat in one window, i.e. in a sublayout
-- find the most useful awesome set of top level layouts, by trying out layouts.
----grid and full are simple and great, but we need to find an awesomeness beyond.

import XMonad  hiding ( (|||) )
import XMonad.Layout.LayoutCombinators -- hiding ( (|||) )
import XMonad.Util.EZConfig -- allows all kinds, like automated emacs submaps 
import XMonad.Actions.Submap -- allows emacs-like keys
import XMonad.Layout.Tabbed
import XMonad.Layout.Grid
import XMonad.Layout.Mosaic
import XMonad.Layout.Groups.Wmii
import qualified XMonad.StackSet as W
import XMonad.Actions.CycleWS
import XMonad.Layout.NoBorders
import XMonad.Layout.OneBig


--trial
--import XMonad.Layout.SimpleFloat
import XMonad.Layout.MultiToggle --allows fullscreen toggle, without Full layout
import XMonad.Layout.MultiToggle.Instances



import XMonad.Actions.DynamicWorkspaces -- hrmm, is this where withNthWorkspace came from... curious.
import XMonad.Actions.CopyWindow(copy) --this too?

--sublayoutstuff http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-SubLayouts.html
import XMonad.Layout.SubLayouts
import XMonad.Layout.WindowNavigation
import XMonad.Layout.BoringWindows


main = xmonad $ defaultConfig
     { modMask = mod4Mask -- use tux instead of alt, which is M1
     , terminal = "xterm"
     , normalBorderColor  = "#487855" --487855 mk1 of "inteligent green"
     , focusedBorderColor = "#ff6900"
     , keys = djtemacsKeys
     , layoutHook = djtslayoutHook
     , workspaces = djtWorktops               
     } -- `additionalKeysP` djtemacsKeys

djtslayoutHook = smartBorders $ windowNavigation $ subTabbed $ boringWindows $
--                 simpleTabbed ||| (Tall 1 (3/100) (1/2) *//* Full)  ||| (Tall 1 (3/100) (1/2) ***||** Full) ||| Full 
                 -- ||| mosaic ||| Grid ||| wmii shrinkText defaultTheme
--                 Grid ||| (Tall 1 (3/100) (1/2) *//* Full)  ||| (Tall 1 (3/100) (1/2) ***||** Full) ||| Full
--                 Grid ||| (Tall 1 (3/100) (1/7) *//* Full)  ||| (Tall 1 (3/100) (1/7) ***||** Full) ||| Full
--                 Grid ||| (Tall 1 (3/100) (1/7) *//* Full)  ||| mosaic 2 [3,2] ||| Full
--                 Grid ||| OneBig (3/4) (3/4) ||| mosaic 9 [3,2] ||| simpleFloat ||| Full 
--                 Grid ||| OneBig (3/4) (3/4) ||| mosaic 1 [7,2] ||| Full
                 mkToggle (NOBORDERS ?? FULL ?? EOT) (Grid ||| OneBig (3/4) (3/4)) -- first of the MultiToggle attempts 
                 
--djtWorktops = ["dmp", "stf","web", "irc", "gmp", "wrk", "sys", "mov", "msc"] ++ map show ["1","2","3","4","5","6","7","8","9","0"]
--djtWorktops = [1..9]
djtWorktops  = ["1","2","3","4","5","6","7","8","9"]
--djtWorktops  = ['1','2','3','4','5','6','7','8','9']

djtemacsKeys = \c -> mkKeymap c $
     [ ("M-S-<Return>", spawn $ terminal c)
     , ("M-x o", spawn "xteddy")  -- type mod+x then w to pop up 'woohoo!'
     , ("M-<F11>", sendMessage $ Toggle FULL)
     , ("M-<F4>", kill)
     , ("M-<F6>", spawn "xkill")
     , ("M-q", spawn "xmonad --recompile && xmonad --restart")
--     , ("M-f2", spawn "dmenu-bind.sh")  
--     , ("M-F2", spawn "dmenu-bind.sh")  
     , ("M-n", spawn "dmenu-bind.sh")  
     , ("M-<F2>", spawn "~/.config/dmenu/dmenu-bind.sh")       
     , ("<Menu>", spawn "8menu")
     , ("M-<Menu>", spawn "dmenu-bind.sh")
     , ("M-<Space>", sendMessage NextLayout)
     , ("M-y u",  sendMessage $ JumpToLayout "Full")  -- jump directly to the Full layout
     , ("M-y i",  sendMessage $ JumpToLayout "Tabbbed Simplest")  -- jump directly to the simpleTabbed Layout
     , ("M-y o",  sendMessage $ JumpToLayout "Tall")  -- jump directly to the Tall layout
       -- here are the wmii-style  keybinds
    -- , ("M-y h", groupToProviousLayout) -- i wish
     , ("M-y w j", zoomGroupIn)
     , ("M-y w k", zoomGroupOut)
     , ("M-y w l", groupToNextLayout)
     , ("M-y w q", zoomGroupReset)
     , ("M-y w u", groupToFullLayout)
     , ("M-y w i", groupToTabbedLayout)
     , ("M-y w o", groupToVerticalLayout)
     , ("M-y w t", toggleGroupFull)
--     , ("M-1",  )  -- was thinking i have to re-write my workspace and layout navigation keys it seems. 
       --gamer controls w,s,a,d.  also suited for other ~one hand on keyboard, one hand on mouse~ type applications, suchas gimp or blender or audacity, etc.
     , ("M-w", windows W.focusDown) --artistgamer
     , ("M-S-C-w", withFocused (sendMessage . UnMerge)) --sublayout --artistgamer?
--     , ("M-a", sendMessage Shrink) --artistgamer --thats my audacity launcher
     , ("M-S-a", sendMessage Shrink) -- Shrink the master area --artistgamer
     , ("M-s", windows W.focusDown) --artistgamer
     , ("M-S-C-s", sendMessage $ pullGroup D) --sublayout --artistgamer
--     , ("M-d", sendMessage Expand) --artistgamer
     , ("M-S-d", sendMessage Expand) -- Expand the master area --artistgamer
     , ("M-C-a", sendMessage $ pullGroup L) --sublayout --artistgamer
     , ("M-C-d", sendMessage $ pullGroup R) --sublayout --artistgamer
     , ("M-C-w", sendMessage $ pullGroup U) --sublayout --artistgamer
     , ("M-C-s", sendMessage $ pullGroup D) --sublayout --artistgamer
     , ("M-C-e", withFocused (sendMessage . UnMerge)) --sublayout --artistgamer
     , ("M-C-S-e", withFocused (sendMessage . MergeAll)) --sublayout --artstgamer
     , ("S-<XF86Back>", sendMessage (IncMasterN (-1)))
     , ("S-<XF86Forward>", sendMessage (IncMasterN (1)))
     , ("M-<XF86Back>", prevWS)
     , ("M-<XF86Forward>", nextWS)
     , ("S-M-<XF86Back>", shiftToPrev)
     , ("S-M-<XF86Forward>", shiftToNext)
     , ("M-<Down>", windows W.focusDown)
     , ("M-<Up>", windows W.focusUp)
     , ("S-M-<Down>", windows W.swapDown)
     , ("S-M-<Up>", windows W.swapUp)
     , ("M-C-h", sendMessage $ pullGroup L) --sublayout
     , ("M-C-l", sendMessage $ pullGroup R) --sublayout
     , ("M-C-k", sendMessage $ pullGroup U) --sublayout
     , ("M-C-j", sendMessage $ pullGroup D) --sublayout
     
     , ("M-S-h", sendMessage Shrink) -- Shrink the master area
     , ("M-S-l", sendMessage Expand) -- Epand the master area

     , ("M-C-m", withFocused (sendMessage . MergeAll)) --sublayout
     , ("M-C-u", withFocused (sendMessage . UnMerge)) --sublayout
     , ("M-C-e", withFocused (sendMessage . UnMerge)) --sublayout --artistgamer

     , ("M-C-<period>", onGroup W.focusUp') --sublayout
     , ("M-C-<comma>", onGroup W.focusDown') --sublayout

     -- original translated to ezconfig emacs style
     -- launch a terminal
--     , ("M-S-<Return>", spawn $ XMonad.terminal conf)

     -- launch dmenu
 --    , ("M-<F2>", spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")

     -- launch gmrun
     , ("M-<F3>", spawn "gmrun")

     -- close focused window
     , ("M-S-c", kill)

     -- Rotate through the available layout algorithms
     , ("M-<space>", sendMessage NextLayout)

     --  Reset the layouts on the current workspace to default
--     , ("M-S-<space>", setLayout $ XMonad.layoutHook conf) 

     -- Resize viewed windows to the correct size
--     , ("M-n", refresh)

     -- Move focus to the next window
     , ("M-<Tab>", windows W.focusDown)

     -- Move focus to the next window
     , ("M-j", windows W.focusDown)

     -- Move focus to the previous window
     , ("M-k", windows W.focusUp  )

     -- Move focus to the master window
     , ("M-m", windows W.focusMaster  )

     -- Swap the focused window and the master window
     , ("M-<Return>", windows W.swapMaster)

     -- Swap the focused window with the next window
     , ("M-S-j", windows W.swapDown  )

     -- Swap the focused window with the previous window
     , ("M-S-k", windows W.swapUp    )


     -- Push window back into tiling
     , ("M-t", withFocused $ windows . W.sink)

     -- Increment the number of windows in the master area
     , ("M-<Comma>", sendMessage (IncMasterN 1))

     -- Deincrement the number of windows in the master area
     , ("M-<Period>", sendMessage (IncMasterN (-1)))

     -- Toggle the status bar gap
     -- Use this binding with avoidStruts from Hooks.ManageDocks.
     -- See also the statusBar function from Hooks.DynamicLog.
     --
     -- , ((modm              , xK_b     ), sendMessage ToggleStruts)

     -- Quit xmonad
--     , ("M-S-q", io (exitWith ExitSuccess))

     -- Restart xmonad
--     , ("M-q", spawn "xmonad --recompile; xmonad --restart") --oops, got athat already, no?
     ]
     ++
     -- (2012-09-29 15:14:37) dr_bs: 
     zip (map (\x -> fst x++[snd x]) ((zip (repeat "M-") (['1'..'9'])))) (map (withNthWorkspace W.greedyView) [0..])

     ++
     -- so i extrapolate from dr_bs's above, and from 
     -- http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-DynamicWorkspaces.html
     zip (map (\x -> fst x++[snd x]) ((zip (repeat "M-S-") (['1'..'9'])))) (map (withNthWorkspace W.shift) [0..])
     

You have been watching; Thanks for listening; This is, and has been:  Digit's Nice Minimal Tabular Boonad (except way not the one planned, nor even complete nor tidy nor nice nor minimal enough... but it's got the name of the lineage to be)  Thankyou, Goodnight, See you again soon, You can see me for more noob xmonad fumblings and discoveries, here, next time i post.  ^_^ 

do have a go and try it out.     :)

the TubularBoonad has a rather different feel to it than default xmonad config (as do many custom xmonad configs, since it's so versatile a wm), so much so i have tried to tug it towards some of the features more familiar in i3 or clfswm... but now i think i have to let it grow, become it's own thing, and prune it to that end, now, rather than force it to be i3fsmad.  ^_^  anyhoo, yeah, give it a shot if you like.  :) 

ps, you nerd, you read all that.  ^_^  you essoteric software trinket explorer you.  ^_^  ;D

pps, i plan to come back with a cleaned up and bugchecked version.  just wanted to share in a moment of excitement.

Offline

Be excellent to each other!

#25 2012-12-04 11:45:49

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 3,010

Re: My Xmonad Adventures

^What happened that lisp based window manager you were waxing about previously? ... cflcunninlinguswm or whatever it's called.


Point & Squirt

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo