You are not logged in.

#1 2007-11-23 22:40:28

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Looking for awesome-style workspace bar for xmonad and bash

Does anyone have a bash-scripted dzen2 status bar that shows the workspaces similar to awesome wm?  Specifically, I'm looking for something that shows the tag numbers or names as well as an indicator showing whether an application is open on that particular workspace... like this:

[ ^1 ]  2  3  ^4  5  6

[ ] == active workspace/tag
^  == application open on that workspace/tag

I hope that makes sense...


thayer williams ~ cinderwick.ca

Offline

#2 2007-11-24 00:34:52

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

Re: Looking for awesome-style workspace bar for xmonad and bash

Not exactly sure what you mean by bash-scripted: xmonad-darcs can do the formatting of the status line a bit easier, and you can even have dzen be started by xmonad, to get rid of all that nasty xinitrc stuff (move it into .xmonad/xmonad.hs).

Take a look in the XMonad.Hooks.DynamicLog (darcs) or XMonad.DynamicLog contributed module docs

So to a pretty empty example config such as dons'
add a function of your custom pretty printing options (also have it called/set)

so this should function quite well as a ~/.xmonad/xmonad.hs for the libitized, darcs xmonad. To get it to run all you need to call is xmonad, and the rest will follow.

{-# OPTIONS_GHC -Wall #-}
import XMonad

import XMonad.Hooks.DynamicLog
 
main = dzen $ \conf -> xmonad $ conf
        { defaultGaps        = [(13,0,0,0)]
         , focusedBorderColor = "#00ff00"
         , logHook            = dynamicLogDzen samplePP
        }

samplePP :: PP
samplePP = defaultPP { ppCurrent  = dzenColor "white" "#2b4f98" . wrap "[\^" "]"
                     , ppVisible  = dzenColor "black" "#999999" . pad
                     , ppHidden   = dzenColor "black" "#cccccc" . pad
                     , ppHiddenNoWindows = const ""
                     }

And you can do similar things with ppHiddenNoWindows to get dzen to show the number (but how is that useful?).
You might have to escape the ^ as \^ because I think that dzen colours are ^somenumber.

On top of that, you need xmonad-darcs and xmonad-darcs-contrib and their dependencies (haskell-x11-darcs)
It is pretty stable; then again X has crashed for me while using it, but other, more risky things are probably to blame.

edit: be aware of spacing/tabs when you write the config: haskell interprets whitespace;
and I use xmobar, which I think is easier, so you could try that too...

Last edited by vogt (2007-11-24 00:37:21)

Offline

#3 2007-11-24 00:46:39

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Looking for awesome-style workspace bar for xmonad and bash

vogt, thanks very much for tips and I'll definitely check out that documentation. 

I mentioned bash simply because the example status bar at the xmonad website utilizes zcsh scripting and I use bash.  I'm only now learning how to script/program so I definitely have a ways to go before I fully understand your examples, but I've taken notes nonetheless.

Cheers


thayer williams ~ cinderwick.ca

Offline

#4 2007-11-24 01:33:47

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

Re: Looking for awesome-style workspace bar for xmonad and bash

yeah, my example kinda sucked: I screwed over the types, damn haskell debuging is especially tough when you don't know what you are doing (which is quite good otherwise).

so this works, and you can actually change the pretty printing stuff.

{-# OPTIONS_GHC -Wall #-}
import XMonad

import XMonad.Hooks.DynamicLog

import XMonad.Layouts
import Data.List
import System.IO
import XMonad.Util.Run

main :: IO ()
main = myDzen $ \conf -> xmonad $ conf
        { defaultGaps        = [(13,0,0,0)]
        , focusedBorderColor = "#00ff00"
        }

myDzen :: (XConfig (Choose Tall (Choose (Mirror Tall) Full)) -> IO ()) -> IO ()
myDzen f = do
  h <- spawnPipe ("dzen2" ++ " " ++ flags)
  f $ defaultConfig
           { defaultGaps = [(15,0,0,0)] -- for fixed
           , logHook = dynamicLogWithPP samplePP
                          { ppOutput = hPutStrLn h } }
 where
    fg      = "'#a8a3f7'" -- n.b quoting
    bg      = "'#3f3c6d'"
    flags   = "-e '' -w 400 -ta l -fg " ++ fg ++ " -bg " ++ bg

samplePP :: PP
samplePP = defaultPP { ppCurrent  = dzenColor "white" "#2b4f98" . wrap "[^ " "]"
                     , ppVisible  = dzenColor "black" "#999999" . pad
                     , ppHidden   = dzenColor "black" "#cccccc" . wrap "^ " " "
                     , ppHiddenNoWindows = dzenColor "black" "#cccccc" . pad
                     }

Last edited by vogt (2007-11-24 01:47:41)

Offline

Board footer

Powered by FluxBB