You are not logged in.

#351 2010-06-17 18:17:02

mokrzu
Member
Registered: 2009-09-27
Posts: 6

Re: xmonad Hacking Thread

hello,
I can't remove blank (transparent) space, on the bottom and right side of program windows that run in urxvt (weechat, vim, tmux, cmus etc.)
screenshot

i tried to use HintedTail and LayoutHints but then i had empty space outside of window.
it's irritating (i use tailing WM because i didn't wont to have empty spaces) smile
is it some solution for that ?

my xmonad.hs may by helpful.

Last edited by mokrzu (2010-06-18 10:43:58)

Offline

#352 2010-06-17 20:18:21

paldepind
Member
From: Århus, Denmark
Registered: 2010-02-17
Posts: 141

Re: xmonad Hacking Thread

Ashren wrote:

paldepind: Du skal bare blive ved.*

I figured out how to configure XMonad but not to program Haskell - is that fail or partially win?

* Just keep at it.

It's definitely a win!

Mr.Elendig: Could you please explain to me how the statusBar function works? I've tried this and this. None worked sad

Btw, do you know what your name means in danish?

Offline

#353 2010-06-17 20:37:32

Nepherte
Member
From: Singapore
Registered: 2008-09-09
Posts: 427
Website

Re: xmonad Hacking Thread

Ashren wrote:

I figured out how to configure XMonad but not to program Haskell - is that fail or partially win?

One can hardly call it a failure. A config file is just copying the things you need, adapt and finally merge them. Knowing Haskell certainly helps, but it's certainly not a must. Before I knew Haskell, I even found xmonad the easiest tiling window manager to configure. 6 Months later, I just learned Haskell.

Offline

#354 2010-06-18 06:55:59

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: xmonad Hacking Thread

By the way, I just found this. Could prove very useful.

Offline

#355 2010-06-18 10:55:58

mokrzu
Member
Registered: 2009-09-27
Posts: 6

Re: xmonad Hacking Thread

problem that I mentioned has cause not i xmonad but in urxvt.
it was said in that topic.

i installed rxvt-unicode-256color-layoutgaps but it didn't help.
it looks like there is no real solution for that hmm

Offline

#356 2010-06-18 12:36:40

Nepherte
Member
From: Singapore
Registered: 2008-09-09
Posts: 427
Website

Re: xmonad Hacking Thread

I've had a similar issue. The following helped me fixing the border gap on the side:

URxvt*internalBorder:0

in ~/.Xdefaults

And this patch helped me with the bottom gaps: http://aur.archlinux.org/packages/rxvt- … gaps.patch
I've built a rxvt-unicode 64bit package with this patch here: http://www.nepherte.be/repos/x86_64/

You can always built it yourself of course.

Offline

#357 2010-06-18 14:04:58

mokrzu
Member
Registered: 2009-09-27
Posts: 6

Re: xmonad Hacking Thread

ok, first advice helped me fix the gap in the side, thanks smile
but i have problem with second step, i installed urxvt from aur with this path, but it didn't help.

i use 32bit arch, so only solution for me is to build package from scratch (i never do that) ?

EDIT: when i changed font from 12 to 13 pix blank space disappear, but it works only for windows that have full hight, others have that blank space. so problem is still unsolved.

Last edited by mokrzu (2010-06-18 14:38:29)

Offline

#358 2010-06-18 15:13:40

Nepherte
Member
From: Singapore
Registered: 2008-09-09
Posts: 427
Website

Re: xmonad Hacking Thread

To build packages from scratch, see the wiki for more information: http://wiki.archlinux.org/index.php/Makepkg
You can find the pkgbuild and files I've used for building rxvt-unicode here: https://svn.ulyssis.org/repos/nepherte/ … t-unicode/ (username: guest, password: guest)

Offline

#359 2010-06-18 17:01:17

mokrzu
Member
Registered: 2009-09-27
Posts: 6

Re: xmonad Hacking Thread

i build it and have effect identical when i've changed font hmm
if window have max hight it's ok, but when i have two or more windows in column this gap appears again.

Nepherte: do you have the same situation? BTW thanks for help with building my first package (in fact it isn't difficult)  wink

Last edited by mokrzu (2010-06-18 17:02:46)

Offline

#360 2010-06-18 18:02:47

Nepherte
Member
From: Singapore
Registered: 2008-09-09
Posts: 427
Website

Re: xmonad Hacking Thread

mokrzu wrote:

Nepherte: do you have the same situation? BTW thanks for help with building my first package (in fact it isn't difficult)  wink

I don't have that problem.

Offline

#361 2010-06-18 19:11:06

mokrzu
Member
Registered: 2009-09-27
Posts: 6

Re: xmonad Hacking Thread

Nepherte wrote:
mokrzu wrote:

Nepherte: do you have the same situation? BTW thanks for help with building my first package (in fact it isn't difficult)  wink

I don't have that problem.

maybe it's mater of layouts we use.
could you paste your xmonad.hs ? i would be grateful.

Last edited by mokrzu (2010-06-18 19:11:20)

Offline

#362 2010-06-18 22:17:02

Nepherte
Member
From: Singapore
Registered: 2008-09-09
Posts: 427
Website

Re: xmonad Hacking Thread

I doubt it's a matter of layouts but you can find my xmonad.hs file here: http://www.nepherte.be/files/config/hom … /xmonad.hs

Offline

#363 2010-06-19 01:05:02

tammer
Member
From: Philadelphia
Registered: 2010-06-18
Posts: 11

Re: xmonad Hacking Thread

Quick question that I can't seem to find an answer for via google:

Is it possible to use dzen2 in XMonad and have dzen appear on only a single workspace? When I launch dzen, it appears across all workspaces regardless of what I specify in myManageHook in my xmonad.hs.

I asked this in the dzen thread, and it appears that XMonad is responsible for this propagation. Is there an eventhook or managehook that will work?

Offline

#364 2010-06-19 10:42:34

Armoletti
Member
Registered: 2008-10-15
Posts: 2

Re: xmonad Hacking Thread

Have any of you used Wine with Xmonad I have little problem with it. I remember same thing happening some month ago with completely different installation.

The problem is that when I move mouse over a floated Steam window started with Wine it moves little bit to bottom-right. So if I move mouse enough window will end up outside of visible area. Same thing happens with World of Warcraft, but it does not happen with notepad. So I figure it might be something to do with some graphic libraries.

I tried some other TiledWM (it was Awesome or Musca) and same thing happens there also so it is not only a Xmonad problem. So I hope this is right place to post this.

One workaround is to set Wine settings to "Emulate a virtual desktop" but I dislike that option.

Has anybody else encountered this?

Completely other matter I think I didn't notice anybody mentioning Bluetile and some new users might be interested about it.

Offline

#365 2010-07-15 03:23:51

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: xmonad Hacking Thread

Hi guys, can anyone help me to float all java windows by default.

xprop yields this:

WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "GUICalc"

WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "org-naurd-media-nwe00xmp3filemanager-NWE003MP3Manager"

WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "org-danizmax-jsymphonic-gui-JSymphonic"

for different java programs.

Offline

#366 2010-07-16 01:49:18

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: xmonad Hacking Thread

tammer wrote:

Quick question that I can't seem to find an answer for via google:

Is it possible to use dzen2 in XMonad and have dzen appear on only a single workspace? When I launch dzen, it appears across all workspaces regardless of what I specify in myManageHook in my xmonad.hs.

I asked this in the dzen thread, and it appears that XMonad is responsible for this propagation. Is there an eventhook or managehook that will work?

Use more than one dzen instance. xmonad will respect the size values.

--EDIT--

Whoops! I read different monitors and not workspaces.

This has been covered before, but I don't remember the outcome.

Sorry.

Offline

#367 2010-07-16 02:06:24

pseup
Member
Registered: 2008-06-06
Posts: 103

Re: xmonad Hacking Thread

x33a wrote:

Hi guys, can anyone help me to float all java windows by default.

xprop yields this:

WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "GUICalc"

WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "org-naurd-media-nwe00xmp3filemanager-NWE003MP3Manager"

WM_CLASS(STRING) = "sun-awt-X11-XFramePeer", "org-danizmax-jsymphonic-gui-JSymphonic"

for different java programs.

You can match against the first string with 'resource'. eg:

resource =? "sun-awt-X11-XFramePeer" --> doFloat

I think there is also some Java specific workarounds in the XMonad FAQ too.

Last edited by pseup (2010-07-16 02:18:34)

Offline

#368 2010-07-16 03:46:25

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: xmonad Hacking Thread

pseup wrote:

You can match against the first string with 'resource'. eg:

resource =? "sun-awt-X11-XFramePeer" --> doFloat

I think there is also some Java specific workarounds in the XMonad FAQ too.

Thanks, that did the trick. As for the faq, there was a workaround for setting up the wm name, which i already did.

Offline

#369 2010-07-22 20:31:29

cbrunos
Member
Registered: 2010-07-22
Posts: 55

Re: xmonad Hacking Thread

Hello everyone!
I started using xmonad just yesterday and I'm loving it! However, I still have some questions (I looked on the internet but didn't find the answer…or it was a bit complicated…) and I hope you might help me. First question, look at this:
nblnV.png
Is there a way to shrink the terminal, so I gain more space for the text editor? Or must I create a new layout?
These are my layouts:

myLayout = avoidStruts (tall ||| Mirror tall ||| Full)
                   where  tall = Tall 1 (3/100) (1/2)

How can I make Gimp always open in Virtual Dsktop 5, with this layout?
IygKG.png

Excuse my noobiness and thanks in advance!

Last edited by cbrunos (2010-07-22 20:33:19)


Xmonad gets sh*t done. Fast.

Offline

#370 2010-07-22 20:44:38

lifeafter2am
Member
From: 127.0.0.1
Registered: 2009-06-10
Posts: 1,332

Re: xmonad Hacking Thread

cbrunos wrote:

Hello everyone!
I started using xmonad just yesterday and I'm loving it! However, I still have some questions (I looked on the internet but didn't find the answer…or it was a bit complicated…) and I hope you might help me. First question, look at this:
http://imgur.com/nblnV.png
Is there a way to shrink the terminal, so I gain more space for the text editor? Or must I create a new layout?
These are my layouts:

myLayout = avoidStruts (tall ||| Mirror tall ||| Full)
                   where  tall = Tall 1 (3/100) (1/2)

You need a new layout.  I have it in mine, but I don't remember the name.  It might be "ResizableTall" ... actually I am pretty sure it is.  After you set that up, you will need to define two more keys as well, to control for the vertical shrinking and expanding of windows, which is done in the main config.  The snippets of my xmonad for all this are below

import XMonad.Layout.ResizableTile
..........
customLayout = gaps [(D,16)] $ avoidStruts $ ResizableTall 2 (3/100) (1/2) [] ||| withIM (1%7) (ClassName "Buddy List") Grid ||| layoutHook defaultConfig
..........
 , ((mod4Mask, xK_a), sendMessage MirrorShrink)
 , ((mod4Mask, xK_z), sendMessage MirrorExpand)

How can I make Gimp always open in Virtual Dsktop 5, with this layout?
http://imgur.com/IygKG.png

Excuse my noobiness and thanks in advance!

Window rules:

-- Window rules
myManageHook = composeAll
        [ title =? "Blender" --> doShift "3:blender"
        , className =? "Luxrender" --> doShift "4:render"
        , title =? "Yafaray" --> doShift "4:render"
        , title =? "SmallLuxGPU" --> doShift "4:render"
        , title =? "Namoroka" --> doShift "2:www"
        , className =? "Gimp" --> doShift "5:image"
        , title =? "Nitrogen" --> doShift "5:image"
        , title =? "EVE1" --> doShift "6:EVE1"
        , title =? "EVE2" --> doShift "7:EVE2"
        ]

#binarii @ irc.binarii.net
Matrix Server: https://matrix.binarii.net
-------------
Allan -> ArchBang is not supported because it is stupid.

Offline

#371 2010-07-22 21:11:30

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: xmonad Hacking Thread

lifeafter2am wrote:
cbrunos wrote:

How can I make Gimp always open in Virtual Dsktop 5, with this layout?
http://imgur.com/IygKG.png

Excuse my noobiness and thanks in advance!

Window rules:

-- Window rules
myManageHook = composeAll
        [ title =? "Blender" --> doShift "3:blender"
        , className =? "Luxrender" --> doShift "4:render"
        , title =? "Yafaray" --> doShift "4:render"
        , title =? "SmallLuxGPU" --> doShift "4:render"
        , title =? "Namoroka" --> doShift "2:www"
        , className =? "Gimp" --> doShift "5:image"
        , title =? "Nitrogen" --> doShift "5:image"
        , title =? "EVE1" --> doShift "6:EVE1"
        , title =? "EVE2" --> doShift "7:EVE2"
        ]

also combine this with onWorkspace:

import XMonad.Layout.PerWorkspace (onWorkspace)

myLayout = onWorkspace "5:gimp" gimpLayout $ Tall ||| Wide -- ||| whatever

  where

    gimpLayout = -- whatever you wanted for gimp, maybe a dual-reflected withIM? :P

Offline

#372 2010-07-22 21:14:27

cbrunos
Member
Registered: 2010-07-22
Posts: 55

Re: xmonad Hacking Thread

Thanks a lot, it works like a charm!
One last question: is there a way to have a preset layout per virtual desktop?

EDIT: sorry t'was a dumb question, you just gave me the answer tongue

Anyway I started reading this, and I found interesting stuff like:
import XMonad.Actions.GridSelect and
import XMonad.Layout.WindowNavigation

I feel so powerfull in front of my keyboard now cool

EDIT2: Hi again, I tried to make WindowNavigation work, and it did, but then I changed some stuff and I doesn't work anymore and I can't see why not.
That's may layouthook:

myLayout = avoidStruts $ windowNavigation $ onWorkspace "5:image" gimpLayout $ standardLayouts
  where
     -- List of layouts to use.
     standardLayouts =    ResizableTall 1 (3/100) (1/2) [] ||| Full
     -- Layout for the GIMP:
     -- Uses the left and right edge of the screen for GIMP's toolboxes (if
     -- they are present). Apart from that, the usual layouts can be used.
     gimpLayout = withIM (0.11) (Role "gimp-toolbox") $
         reflectHoriz $
         withIM (0.15) (Role "gimp-dock") standardLayouts
     -- default tiling algorithm partitions the screen into two panes
     tiled   = Tall nmaster delta ratio
     -- 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   = 3/100

and the keybinds are configurated. L looked at some posts in the forum where people use WindowNavigation and I did exactly the same!

EDIT4: Ok I made it work, I was actually editing my xmonad.hs backup and not the actual xmonad.hs…epic fail

Last edited by cbrunos (2010-07-23 15:01:39)


Xmonad gets sh*t done. Fast.

Offline

#373 2010-07-23 19:01:25

tammer
Member
From: Philadelphia
Registered: 2010-06-18
Posts: 11

Re: xmonad Hacking Thread

This thread is a really great resource! Even if there isn't a specific answer to a question there's enough information on this thread to create some really unique interfaces.

One more quick question, if anybody knows. Is it possible to only show borders between tiles and not on the edges of the screen? I.e., when in mirrored layout, I want the gaps to only appear on the inside of the screen, and have the tiles go all the way to the edge of the screen.

I know how to remove the gaps completely from a layout, but I can't seem to find out how to remove the edge borders only.

Offline

#374 2010-07-24 04:24:27

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: xmonad Hacking Thread

Offtopic post:

cbrunos wrote:

EDIT4: Ok I made it work, I was actually editing my xmonad.hs backup and not the actual xmonad.hs…epic fail

lmao lol

Sorry, had to do this tongue

A similar thing happened to me a few days ago, i was compiling my java code and couldn't get the desired results, and later realized i was compiling a different copy.

Offline

#375 2010-07-27 21:45:30

count-corrupt
Member
From: Germany
Registered: 2009-02-01
Posts: 112

Re: xmonad Hacking Thread

I wanted to share my setup for a while and i finally think it's about worth it. Some of my ideas come from this thread, some are taken from elsewhere and some I came up with while hacking.

There are still a few things to sort out like how to make Photoshop's floating dialogs stop moving on their own and a few other minor annoyances.
Also there's some stuff I either haven't managed to do yet like making trayer dynamically expand and the statusbar move to the left accordingly or haven't had the time to dig into like using socat to split my conky output and pipe it into multiple dzen's while still having just one instance of conky running.

First a few screens:

thumb-main.png
My main workspace. I use xcompmgr for transparency and have these three terminals open most of the time. Also my urgent-indicator can be seen here, obviously there's something going on on my IM workspace.

thumb-main-overlay.png
I love the maximize layout. Here I maximized the main terminal. This overlay effect is just waay to cool (and really handy too) not to have it.

thumb-web.png
My web workspace. Nothing out of the ordinary, just vimperator and the zenburn colorscheme.

thumb-im.png
The IM workspace. I used XMonad.Layout.IM and XMonad.Layout.Reflect to create room for pidgin and skype on either side of the screen and use a normal tiled layout in the middle. Both IM clients are exactly 175px wide and stay that way even if no chatwindow is open. They also open on that workspace if started.

thumb-img.png
This is a workspace I created for use with Gimp. It's almost the same setup as the IM workspace, only using a different layout in the center. Gimp's toolbox will always align left and the dockable dialogs to the right, creating a Photoshop-like interface. This should become redundant once Gimp 2.7 releases. But it has proven a very handy layout so far.

My whole .xmonad dir with all graphics, configs and hopefully everything else needed to run the setup can be checked out from

svn://giggedy.de/corrupt/config/.xmonad

But for the sake of completeness, here's my xmonad.hs:

-- imports {{{
import XMonad hiding ( (|||) ) -- don't import the ||| operator, it comes in layoutcombinators
import XMonad.ManageHook
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
 --hopefully making matlab run
import XMonad.Hooks.SetWMName
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.UrgencyHook
import XMonad.Hooks.FadeInactive
import XMonad.Hooks.ManageHelpers
import XMonad.Util.Cursor
import XMonad.Util.Run
import XMonad.Util.Dmenu
import XMonad.Util.Loggers
import XMonad.Util.NamedWindows
import XMonad.Util.WorkspaceCompare
import XMonad.Layout.NoBorders
import XMonad.Layout.ResizableTile
import XMonad.Layout.HintedTile
import XMonad.Layout.Grid
import XMonad.Layout.Magnifier
import XMonad.Layout.LayoutHints
import XMonad.Layout.IM
import XMonad.Layout.PerWorkspace
import XMonad.Layout.Reflect
import XMonad.Layout.LayoutCombinators
import XMonad.Layout.Cross
import XMonad.Layout.Named
import XMonad.Layout.Maximize
import XMonad.Layout.Simplest
import XMonad.Layout hiding ( (|||) )
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Core
import XMonad.Actions.GridSelect
import XMonad.Actions.NoBorders
import XMonad.Actions.Plane
import qualified XMonad.StackSet as W
import qualified Data.Map as M
import System.Process
import System.IO
import Data.List
import Data.Maybe ( catMaybes, isJust )

-- }}}

-- hooks {{{
myManageHook = composeAll --composeAll applies every hook, instead of composeOne which will stop after the first match
    [ (role =? "gimp-toolbox" <||> role =? "gimp-image-window" <||> role =? "gimp-dock") --> (ask >>= doF . W.sink)
    , name =? "Copying" --> doCenterFloat -- Krusader copy dialog
        , className =? "Gimp" --> doF (W.shift "img")
        , className =? "Gimp-2.6" --> doF (W.shift "img") -- sometimes gimp has "Gimp-2.6" as classname
    , className =? "Pidgin" --> doF (W.shift "IM")
    , className =? "Pidgin" --> doF (W.swapDown)
    , className =? "Skype" --> doF (W.shift "IM")
    , className =? "Firefox" --> doF (W.shift "web")
    , className =? "." --> doFloat -- eclipse splash
    , (className =? "truecrypt" <||> className =? "Truecrypt") --> doFloat -- Truecrypt password dialog
    , (className =? "pcmanfm" <||> className =? "Pcmanfm") --> doF (W.shift "fm")
    , (className =? "amarok" <||> className =? "Amarok") --> doF (W.shift "laut")
    , isFullscreen --> doFullFloat -- fullscreen flash and stuff
    , transience' -- focus parent windows of transient ones
        ]
    where
        role = stringProperty "WM_WINDOW_ROLE"
        name = stringProperty "WM_NAME"

newManageHook = manageDocks <+> myManageHook <+> manageHook defaultConfig

myUrgencyHook = withUrgencyHook dzenUrgencyHook
    { args = ["-bg", myBgColor, "-fg", "'#FF0000'"] } 

myLayoutHook = onWorkspace "IM" (named "myIM" imlayout) $
               onWorkspace "img" (named "myImg" gimp) $
               named "myTall" (myLayoutMods tiled) |||
               named "myMirrorTall"  (myLayoutMods $ Mirror tiled) |||
               named "myMagnifyTall" (myLayoutMods $ magnify tiled) |||
               named "myFull" (myLayoutMods $ noBorders Full) |||
               named "myCross" (myLayoutMods simpleCross) |||
               named "multimedia" ( noBorders Simplest )
    where 
      tiled = ResizableTall nmaster delta ratio []
      -- imlayout makes pidgin and skype occupy 175px at either side of the screen and puts a regular tiled layout in the middle
      -- using myLayoutMods on the gimp or IM layout does more damage than it helps, so just avoidStruts here
      -- also can't just use "tiled" layout on IM because a single window wouldn't have borders
      imlayout = avoidStruts $ withIM (0.137) (Role "buddy_list") $ reflectHoriz $ ((withIM (0.159) (ClassName "Skype") (reflectHoriz tiled )))
      gimp = avoidStruts $ withIM (0.15) (Role "gimp-toolbox") $
             reflectHoriz $ withIM (0.2) (Role "gimp-dock") (ResizableTall 3 delta ratio [])
      nmaster = 1
      delta = 3/100
      ratio = 1/2
      magnify = magnifiercz (1.2)
      myLayoutMods x = maximize $ avoidStruts $ layoutHintsToCenter $ smartBorders x

myLogHook = ewmhDesktopsLogHook >> setWMName "LG3D"

myStartupHook = setWMName "LG3D" >> setDefaultCursor xC_left_ptr
--}}}

-- defines {{{

mrtDraggerOffset :: Position
mrtDraggerOffset = 1

mrtDraggerSize :: Dimension
mrtDraggerSize = 2

myWorkspaces = ["main", "web", "fm", "IM", "img", "laut"] ++ map show [7 .. 8 :: Int]

escapeColor :: String -> String
escapeColor str = "'" ++ str ++ "'"

myModMask = mod4Mask
myFont = "'-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*'"

myFgColor = "#59bbe8"
myBgColor = "#0d0d0d"
myFontColor = "#cccccc"

myFocusedBorderColor = myFgColor
myNormalBorderColor = myBgColor 

myPanelHeight = "16"
myPanelY = "0"
myTerminal = "urxvt"

myMainPanelWidth = "490"
myConkyPanelWidth = "680"
myTrayerWidth = "110"
myTrayerMargin = "1170" --mainpanel + conkypanel

myTrayerCmd  = "trayer "
            ++ " --edge top "
            ++ " --align left "
            ++ " --margin " ++ myTrayerMargin 
            ++ " --widthtype pixel "
            ++ " --height " ++ myPanelHeight
            ++ " --width " ++ myTrayerWidth
            ++ " --transparent true "
            ++ " --alpha 0 "
            ++ " --tint 0x1A1A1A "

myDzenFlags  = " -bg " ++ escapeColor myBgColor
            ++ " -fg " ++ escapeColor myFontColor
            ++ " -e 'onstart=lower' "
            ++ " -h " ++ myPanelHeight
            ++ " -fn " ++ myFont
            ++ " -sa c "
            ++ " -y " ++ myPanelY
            ++ " -xs 0 "

statusBarCmd  = "dzen2 "
             ++ myDzenFlags
             ++ " -w " ++ myMainPanelWidth
             ++ " -ta l " 

secondBarCmd  = "conky -c ~/.xmonad/conkyrc | dzen2 " 
             ++ myDzenFlags
             ++ " -w " ++ myConkyPanelWidth
             ++ " -x " ++ myMainPanelWidth
             ++ " -ta r "

--myXcompmgrCmd = "xcompmgr -cCfF -D5 -o0 -r0"
myXcompmgrCmd = "xcompmgr"

myDmenuString  = "dmenu_run "
              ++ " -fn " ++ myFont
              ++ " -nb " ++ escapeColor myBgColor
              ++ " -nf " ++ escapeColor myFontColor
              ++ " -sb " ++ escapeColor myFgColor
              ++ " -sf " ++ escapeColor myBgColor
              ++ " -i " -- match case-insensitively
-- }}}

-- The prompt config {{{
myPromptConfig :: XPConfig
myPromptConfig = defaultXPConfig
    { position          = Top
    , promptBorderWidth = 0
    , font              = myFont 
    , height            = 16
    , bgColor           = myBgColor
    , fgColor           = myFgColor
    , bgHLight          = myFgColor
    , fgHLight          = myBgColor
    }
-- }}}

-- the keys config {{{
myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
    [ ((myModMask, xK_p), spawn myDmenuString)
    , ((myModMask, xK_b), sendMessage ToggleStruts)
    , ((myModMask, xK_y), sendMessage MirrorShrink) --resizableTall keys
    , ((myModMask, xK_a), sendMessage MirrorExpand)
    , ((myModMask .|. shiftMask, xK_l), spawn ("xlock"))
    , ((myModMask .|. shiftMask, xK_x), spawn ("alock -auth pam"))
    , ((myModMask .|. shiftMask, xK_e), spawn ("dolphin"))
    , ((myModMask .|. shiftMask, xK_f), spawn ("firefox"))
    , ((myModMask .|. shiftMask, xK_a), spawn ("amarok"))
    , ((myModMask .|. shiftMask, xK_g), spawn ("gimp"))
    , ((myModMask .|. shiftMask, xK_p), spawn ("pidgin"))
    , ((myModMask .|. shiftMask, xK_w), spawn (myTerminal ++ " -e wicd-curses"))
    , ((myModMask, xK_q), spawn ("killall dzen2 ; killall conky ; killall trayer ; killall xcompmgr ; xmonad --recompile && xmonad --restart"))
    , ((myModMask, xK_F1), (sendMessage $ JumpToLayout "myTall"))
    , ((myModMask, xK_F2), (sendMessage $ JumpToLayout "myMirrorTall"))
    , ((myModMask, xK_F3), (sendMessage $ JumpToLayout "myMagnifyTall"))
    , ((myModMask, xK_F4), (sendMessage $ JumpToLayout "myFull"))
    , ((myModMask, xK_F5), (sendMessage $ JumpToLayout "myCross"))
    , ((myModMask, xK_F8), (sendMessage $ JumpToLayout "multimedia"))
    , ((myModMask, xK_F11), spawn "killall xcompmgr")
    , ((myModMask, xK_F12), spawn ("killall xcompmgr;" ++ myXcompmgrCmd))
    , ((myModMask, xK_u), withFocused (sendMessage . maximizeRestore))
    , ((myModMask, xK_g), withFocused toggleBorder)
    , ((myModMask, xK_o), shellPrompt myPromptConfig) 
    , ((myModMask, xK_Tab), goToSelected defaultGSConfig) 
    ]
-- }}}
   
-- the PP config {{{

imagePath = "/home/corrupt/.xmonad/images/"

ppCurrentColor = dzenColor "#1a1a1a" myFocusedBorderColor 
ppVisibleColor = dzenColor myFocusedBorderColor ""
ppHiddenColor  = dzenColor myFontColor ""
ppHiddenNWColor = dzenColor myFontColor ""
ppLayoutColor = dzenColor myFontColor ""
ppTitleColor = dzenColor myFontColor ""
ppUrgentColor = dzenColor "#1a1a1a" myFontColor

myPP = dzenPP
    { ppCurrent         = ppCurrentColor . \a -> image "window-active" ++ a ++ setFgColor ++ image "vspace" 
    , ppVisible         = ppVisibleColor . wrapClickable
    , ppHidden          = ppHiddenColor . (\a -> setFgColor ++ image "window" ++ setTextColor ++ a) . wrapClickable
    , ppHiddenNoWindows = ppHiddenNWColor . (\wsId -> if (':' `elem` wsId) then drop 2 wsId else wsId) . wrapClickable
    , ppUrgent          = ppUrgentColor . (\a -> image "window-active" ++ a ++ setTextColor ++ image "vspace") . dzenStrip 
    , ppLayout          = ppLayoutColor . wrapLayoutSwitch .
                          (\ x -> fill (case x of
                              "myTall"        -> "Tall"        ++ setFgColor ++ imagePad "tall"
                              "myMirrorTall"  -> "MirrorTall"  ++ setFgColor ++ imagePad "mtall"
                              "myFull"        -> "Full"        ++ setFgColor ++ imagePad "full"
                              "myCross"       -> "Cross"       ++ setFgColor ++ imagePad "cross"
                              "myMagnifyTall" -> "MagnifyTall" ++ setFgColor ++ imagePad "magnify"
                              "myIM"          -> "IM"          ++ setFgColor ++ imagePad "im"
                              "myImg"         -> "Gimp Grid"   ++ setFgColor ++ imagePad "gimp"
                              _               -> pad x) 4)
    , ppSep             = " | "
    , ppWsSep           = " "
    , ppTitle           = ppTitleColor . dzenEscape
    }
    where
      setFgColor = "^fg(" ++ myFgColor ++ ")"
      setTextColor = "^fg(" ++ myFontColor ++ ")"
      setBgColor = "^fg(" ++ myBgColor ++ ")"
      fill :: String -> Int -> String
      fill h i = "^p(" ++ show i ++ ")" ++ h ++ "^p(" ++ show i ++ ")"
      image :: String -> String
      image img = "^i(" ++ imagePath ++ img ++ ".xbm)"
      imagePad :: String -> String
      imagePad img = " " ++ (image img)
      currentWsIndex w = case (elemIndex w myWorkspaces) of -- needs to be modified should I decide to use DynamicWorkspaces one day
                                Nothing -> "1"
                                Just n -> show (n+1)
      wrapClickable content = "^ca(1,xdotool key super+" ++  (currentWsIndex content) ++ ")" ++ content ++ "^ca()"
      wrapLayoutSwitch content = "^ca(1,xdotool key super+space)" ++ content ++ "^ca()"

-- }}}

main = do
     secondBar <- spawnPipe secondBarCmd
     din <- spawnPipe statusBarCmd
     spawn myTrayerCmd
     spawn myXcompmgrCmd 
     xmonad $ myUrgencyHook
            $ ewmh defaultConfig
        { manageHook = newManageHook 
                , layoutHook = myLayoutHook
        , startupHook = myStartupHook
                , focusedBorderColor = myFocusedBorderColor
                , normalBorderColor = myNormalBorderColor
        , borderWidth = 2
                , workspaces = myWorkspaces
                , modMask = myModMask
        , keys = \c -> myKeys c `M.union` keys defaultConfig c
        , logHook = myLogHook >> (dynamicLogWithPP $ myPP
                { ppOutput = hPutStrLn din
                })
                , terminal = myTerminal
         }

-- vim: fdm=marker ts=4 sw=4 sts=4 et:

I'm still working on it so it might look inconsistent at times. Also my haskell skills improve and I tend to rework each section I'm modifying according to what I learned since I initially wrote it.

I'm using dzen with support for xpm's, conky for the status info, trayer, dmenu, xcompmgr and I start all of them from within xmonad. That way I can control certain parts of it. For example, Mod+q not just restarts xmonad, but kills all dzen2, trayer, conky and xcompmgr instances before that. So whenever one of those programs hangs (which doesn't happen really) or I want to restart the whole thing, I can just hit one button and I'm done. I also have the shortcuts Mod+F11 to disable compositing (killall xcompmgr) and Mod+F12 to re-enable it.
Other than that I find XMonad to be more and more of a complete replacement for everything I needed from a desktop. Fullscreen flash and video-playback works through the magic of XMonad.Hooks.Managehelpers' isFullscreen and doFullFloat, and for games I have a combo that switches to the 'simplest' layout, to allow them to work.
I do have a few problems with Java programs (Matlab) sometimes responding funny or, as mentioned, some Windows software in Wine.

Edit: Btw, the workspaces in dzen are clickable, also configured from within xmonas.hs

I'm very open to suggestions, comments and criticism.

Last edited by count-corrupt (2010-07-27 21:54:02)

Offline

Board footer

Powered by FluxBB