[SOLVED] - XMonad Workspaces

Hi, I need a bit of help with my workspaces, I use
workspaces = [supWsNum "1" "net",supWsNum "2" "screen",supWsNum "3" "files",supWsNum "4" "chat",supWsNum "5" "hotot",supWsNum "6" "",supWsNum "7" "",supWsNum "8" "",supWsNum "9" ""]
where
supWsNum wsName wsNum =" " ++ wsName ++ "^p(;_TOP)^fn(" ++ mySmallFont ++ ")" ++ wsNum ++ " ^fn()^p()"
but how would I reference them in
myManageHook = composeAll
[ className =? "Pidgin" --> doF (W.shift "1")
, className =? "Firefox" --> doF (W.shift "1")
, className =? "Namoroka" --> doF (W.shift "1")
, className =? "Hotot" --> doF (W.shift "5")
, className =? "Chromium" --> doF (W.shift "1")
, className =? "uzbl-browser" --> doF (W.shift "1")
, className =? "jumanji" --> doF (W.shift "1")
, className =? "MPlayer" --> doF (W.shift "1")
, manageDocks
where
role = stringProperty "WM_WINDOW_ROLE"
and
myLayouts = avoidStruts $ smartBorders $
onWorkspace "4" (named "IM" (reflectHoriz $ withIM (1%8) (Title "Buddy List") (reflectHoriz $ dwmStyle shrinkText myTheme tiled ||| (smartBorders $ tabs)))) $
onWorkspace "6" (named "Float" (simplestFloat)) $
onWorkspace "1" (tabs) $
(tiled ||| named "Mirror" (Mirror tiled) ||| tabs)
where
tiled = named "Tall" (ResizableTall 1 (3/100) (1/2) [])
tabs = named "Tabs" (tabbed shrinkText myTheme)
Cheers
Paul-S
Last edited by Paul-S (2010-12-05 16:28:43)

Got it working
myManageHook = composeAll
[ className =? "Pidgin" --> moveTo 3
, className =? "Firefox" --> moveTo 0
, className =? "Namoroka" --> moveTo 0
, className =? "Hotot" --> moveTo 4
, className =? "Chromium" --> moveTo 0
, className =? "uzbl-browser" --> moveTo 0
, className =? "jumanji" --> moveTo 0
, className =? "MPlayer" --> moveTo 0
, manageDocks
where moveTo i = doF . W.shift $ if i == -1 then last myWorkspaces else myWorkspaces !! i
and
myLayouts = avoidStruts $ smartBorders $
onWorkspace (myWorkspaces !! 3) (named "IM" (reflectHoriz $ withIM (1%8) (Title "Buddy List") (reflectHoriz $ dwmStyle shrinkText myTheme tiled ||| (smartBorders $ tabs)))) $
onWorkspace (myWorkspaces !! 5) (named "Float" (simplestFloat)) $
onWorkspace (myWorkspaces !! 0) (tabs) $
(tiled ||| named "Mirror" (Mirror tiled) ||| tabs)
where
tiled = named "Tall" (ResizableTall 1 (3/100) (1/2) [])
tabs = named "Tabs" (tabbed shrinkText myTheme)
Cheers
Paul-S
Last edited by Paul-S (2010-12-05 15:55:32)

Similar Messages

  • [SOLVED] Xmonad updatepointer help

    hello Ive recently moved to arch and now xmonad. And I cannot believe i did not discover these beauties before!! (Previous distro was fedora)
    So little by little with google and examples of configs out there ive manage to customize a xmonad.hs file to how i work and would like to work.
    To a degree i can read my own hs file but some things idk what they do or how they work (like main).
    I would basically like to implement an update pointer action. I've seen the 3rd party extensions page for xmonad but i can seem to figure out how to implement it in my xmonad config file.
    I created a "myLogHook" variable (not sure if that's what haskell calls it) but dont know where to go from there. Here is my config:
    import System.IO
    import System.Exit
    import XMonad
    import XMonad.Hooks.DynamicLog
    import XMonad.Hooks.ManageDocks
    import XMonad.Hooks.ManageHelpers
    import XMonad.Hooks.SetWMName
    import XMonad.Layout.Fullscreen
    import XMonad.Layout.NoBorders
    import XMonad.Layout.Spiral
    import XMonad.Layout.Tabbed
    import XMonad.Layout.ThreeColumns
    import XMonad.Util.Run(spawnPipe)
    import XMonad.Util.EZConfig(additionalKeys)
    import qualified XMonad.StackSet as W
    import qualified Data.Map as M
    import XMonad.Actions.SpawnOn
    import XMonad.Actions.CycleWS
    import XMonad.Actions.PhysicalScreens
    import XMonad.Layout.Circle
    import XMonad.Actions.UpdatePointer
    -- FOR MULTIMEDIA KEYS RUN:
    -- "xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'"
    -- Then look in /usr/include/X11/XF86keysym.h and look for the name and code.
    -- Terminal
    -- The preferred terminal program, which is used in a binding below and by
    -- certain contrib modules.
    myTerminal = "terminator"
    myInternet = "google-chrome-stable"
    myIM = "pidgin"
    myCalc = "libreoffice --calc"
    myEditor = "gedit"
    myBackground = "feh --bg-scale '/home/dvm/Pictures/infinity___widescreen_pack_by_morague.jpg'"
    myScreenshot = "scrot /home/dvm/Pictures/screen_%Y-%m-%d-%H-%M-%S.png -d 1"
    myMouseshot = "sleep 0.2; scrot -s ~/Pictures/screen_%Y-%m-%d-%H-%M-%S.png -d 1"
    myVirtual = "virtualbox"
    myRdesktop = "/home/dvm/.xmonad/bin/usrds006"
    myWTL = "/home/dvm/.xmonad/bin/wtl.sh"
    -- Workspaces
    -- The default number of workspaces (virtual screens) and their names.
    myWorkspaces = ["1:main","2:www","3:office","4:rdp","5:editor","6:email","7:files","8:chat","9:WTL"]
    -- Window rules
    -- Execute arbitrary actions and WindowSet manipulations when managing
    -- a new window. You can use this to, for example, always float a
    -- particular program, or have a client always appear on a particular
    -- workspace.
    -- To find the property name associated with a program, use
    -- > xprop | grep WM_CLASS
    -- and click on the client you're interested in.
    -- To match on the WM_NAME, you can use 'title' in the same way that
    -- 'className' and 'resource' are used below.
    myManageHook = composeAll
    [ resource =? "desktop_window" --> doIgnore
    , className =? "Galculator" --> doFloat
    , className =? "Steam" --> doFloat
    , className =? "Gimp" --> doFloat
    , resource =? "gpicview" --> doFloat
    , className =? "MPlayer" --> doFloat
    , className =? "Google-chrome-stable" --> doShift "2:www"
    , className =? "libreoffice-calc" --> doShift "3:office"
    , className =? "VirtualBox" --> doShift "3:office"
    , className =? "rdesktop" --> doShift "4:rdp"
    , className =? "Gedit" --> doShift "5:editor"
    , className =? "Evolution" --> doShift "6:email"
    , className =? "Nautilus" --> doShift "7:files"
    , className =? "Pidgin" --> doShift "8:chat"
    , className =? "Wine" --> doShift "9:WTL"
    , className =? "stalonetray" --> doIgnore
    , isFullscreen --> (doF W.focusDown <+> doFullFloat)]
    -- Layouts
    -- You can specify and transform your layouts by modifying these values.
    -- If you change layout bindings be sure to use 'mod-shift-space' after
    -- restarting (with 'mod-q') to reset your layout state to the new
    -- defaults, as xmonad preserves your old layout settings by default.
    -- The available layouts. Note that each layout is separated by |||,
    -- which denotes layout choice.
    myLayout = avoidStruts (
    Tall 1 (3/100) (1/2) |||
    Mirror (Tall 1 (3/100) (1/2)) |||
    tabbed shrinkText tabConfig |||
    Full |||
    Circle |||
    spiral (6/7)) |||
    noBorders (fullscreenFull Full)
    -- Colors and borders
    -- Currently based on the ir_black theme.
    myNormalBorderColor = "#000000"
    myFocusedBorderColor = "#FF0000"
    -- Colors for text and backgrounds of each tab when in "Tabbed" layout.
    tabConfig = defaultTheme {
    activeBorderColor = "#FF0000",
    activeTextColor = "#CEFFAC",
    activeColor = "#000000",
    inactiveBorderColor = "#FF0000",
    inactiveTextColor = "#EEEEEE",
    inactiveColor = "#000000"
    -- Color of current window title in xmobar.
    xmobarTitleColor = "#00ff00"
    -- Color of current workspace in xmobar.
    xmobarCurrentWorkspaceColor = "#ee9a00"
    -- Width of the window border in pixels.
    myBorderWidth = 2
    -- Key bindings
    -- modMask lets you specify which modkey you want to use. The default
    -- is mod1Mask ("left alt"). You may also consider using mod3Mask
    -- ("right alt"), which does not conflict with emacs keybindings. The
    -- "windows key" is usually mod4Mask.
    myModMask = mod4Mask
    myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
    -- Custom key bindings
    -- Start a terminal. Terminal to start is specified by myTerminal variable.
    [ ((modMask .|. controlMask, xK_t), spawn $ XMonad.terminal conf)
    -- Lock the screen using xscreensaver.
    , ((0, 0x1008FF2F), spawn "xscreensaver-command -lock")
    -- Run dmenu
    , ((modMask, xK_p), spawn "dmenu_run")
    -- Launch remote desktop script
    , ((modMask .|. controlMask, xK_r), spawn myRdesktop)
    -- Launch Google Chrome
    , ((modMask .|. controlMask, xK_i), spawn myInternet)
    -- Launch Gedit
    , ((modMask .|. controlMask, xK_g), spawn myEditor)
    -- Launch Libreoffice Calc
    , ((modMask .|. controlMask, xK_c), spawn myCalc)
    -- Launch Virtualbox
    , ((modMask .|. controlMask, xK_v), spawn myVirtual)
    -- Launch Evolution Email Client
    , ((modMask .|. controlMask, xK_e), spawn "evolution")
    -- Launch WT Library
    , ((modMask .|. controlMask, xK_w), spawn myWTL)
    -- Launch nautilius File Manager
    , ((modMask .|. controlMask, xK_f), spawn "nautilus")
    -- Switch to next workspace
    , ((modMask, xK_Page_Up), nextWS)
    -- Switch to prev workspace
    , ((modMask, xK_Page_Down), prevWS)
    -- Take a screenshot in select mode.
    -- After pressing this key binding, click a window, or draw a rectangle with the mouse.
    , ((modMask, xK_Print), spawn myMouseshot)
    -- Take full screenshot in multi-head mode.
    -- That is, take a screenshot of everything you see.
    -- , ((modMask .|. controlMask .|. shiftMask, xK_p), spawn "screenshot")
    , ((0, xK_Print), spawn myScreenshot)
    -- Fetch a single use password.
    , ((modMask .|. shiftMask, xK_o), spawn "fetchotp -x")
    -- Mute volume.
    -- , ((0, xK_F9), spawn "amixer -q set Master toggle")
    , ((0, 0x1008FF12), spawn "amixer -q set Master toggle")
    -- Decrease volume.
    -- , ((0, xK_F10), spawn "amixer -q set Master 10%-")
    , ((0, 0x1008FF11), spawn "amixer -q set Master 10%-")
    -- Increase volume.
    -- , ((0, xK_F11), spawn "amixer -q set Master 10%+")
    , ((0, 0x1008FF13), spawn "amixer -q set Master 10%+")
    -- Audio previous.
    , ((0, 0x1008FF16), spawn "")
    -- Play/pause.
    , ((0, 0x1008FF14), spawn "")
    -- Audio next.
    , ((0, 0x1008FF17), spawn "")
    -- Audio stop.
    , ((0, 0x1008FF15), spawn "")
    -- Eject CD tray.
    -- , ((0, 0x1008FF2C), spawn "eject -T")
    -- Switch to Prev Xinerama
    , ((modMask, xK_Right), onPrevNeighbour W.view)
    -- Switch to Next Xinerama
    , ((modMask, xK_Left), onNextNeighbour W.view)
    -- Switch to Prev Workspace
    , ((modMask, xK_Down), prevWS)
    -- Switch to Next Workspace
    , ((modMask, xK_Up), nextWS)
    -- "Standard" xmonad key bindings
    -- Close focused window.
    , ((modMask .|. shiftMask, xK_c), kill)
    -- Cycle through the available layout algorithms.
    , ((modMask, xK_space), sendMessage NextLayout)
    -- Reset the layouts on the current workspace to default.
    , ((modMask .|. shiftMask, xK_space), setLayout $ XMonad.layoutHook conf)
    -- Resize viewed windows to the correct size.
    , ((modMask, xK_n), refresh)
    -- Move focus to the next window.
    , ((modMask, xK_Tab), windows W.focusDown)
    -- Move focus to the next window.
    , ((modMask, xK_j), windows W.focusDown)
    -- Move focus to the previous window.
    , ((modMask, xK_k), windows W.focusUp )
    -- Move focus to the master window.
    , ((modMask, xK_m), windows W.focusMaster )
    -- Swap the focused window and the master window.
    , ((modMask, xK_Return), windows W.swapMaster)
    -- Swap the focused window with the next window.
    , ((modMask .|. shiftMask, xK_j), windows W.swapDown )
    -- Swap the focused window with the previous window.
    , ((modMask .|. shiftMask, xK_k), windows W.swapUp )
    -- Shrink the master area.
    , ((modMask, xK_h), sendMessage Shrink)
    -- Expand the master area.
    , ((modMask, xK_l), sendMessage Expand)
    -- Push window back into tiling.
    , ((modMask, xK_t), withFocused $ windows . W.sink)
    -- Increment the number of windows in the master area.
    , ((modMask, xK_comma), sendMessage (IncMasterN 1))
    -- Decrement the number of windows in the master area.
    , ((modMask, xK_period), sendMessage (IncMasterN (-1)))
    -- Toggle the status bar gap.
    -- TODO: update this binding with avoidStruts, ((modMask, xK_b),
    -- Quit xmonad.
    , ((modMask .|. shiftMask, xK_q), io (exitWith ExitSuccess))
    -- Restart xmonad.
    , ((modMask, xK_q), restart "xmonad" True)
    ++
    -- mod-[1..9], Switch to workspace N
    -- mod-shift-[1..9], Move client to workspace N
    [((m .|. modMask, k), windows $ f i)
    | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_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 .|. modMask, 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)]]
    -- Mouse bindings
    -- Focus rules
    -- True if your focus should follow your mouse cursor.
    myFocusFollowsMouse :: Bool
    myFocusFollowsMouse = True
    myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $
    -- mod-button1, Set the window to floating mode and move by dragging
    ((modMask, button1),
    (\w -> focus w >> mouseMoveWindow w))
    -- mod-button2, Raise the window to the top of the stack
    , ((modMask, button2),
    (\w -> focus w >> windows W.swapMaster))
    -- Closed focus window. Modmask + Ctrl + Middle mouse button.
    , ((modMask .|. controlMask, button2), (\w -> focus w >> kill))
    -- mod-button3, Set the window to floating mode and resize by dragging
    , ((modMask, button3),
    (\w -> focus w >> mouseResizeWindow w))
    -- you may also bind events to the mouse scroll wheel (button4 and button5)
    -- mod-button4, Switch to next workspace
    , ((modMask, button4),
    (\w -> focus w >> nextWS))
    -- mod-button5, Switch to previous workspace
    , ((modMask, button5),
    (\w -> focus w >> prevWS))
    -- Status bars and logging
    -- Perform an arbitrary action on each internal state change or X event.
    -- See the 'DynamicLog' extension for examples.
    -- To emulate dwm's status bar
    -- > logHook = dynamicLogDzen
    myLogHook = updatePointer (Relative 1 1)
    -- Startup hook
    -- Perform an arbitrary action each time xmonad starts or is restarted
    -- with mod-q. Used by, e.g., XMonad.Layout.PerWorkspace to initialize
    -- per-workspace layout choices.
    -- By default, do nothing.
    myStartupHook = return ()
    -- Run xmonad with all the defaults we set up.
    main = do
    xmproc <- spawnPipe "xmobar ~/.xmonad/xmobar.hs"
    xmonad $ defaults {
    logHook = dynamicLogWithPP $ xmobarPP {
    ppOutput = hPutStrLn xmproc
    , ppTitle = xmobarColor xmobarTitleColor "" . shorten 50
    , ppCurrent = xmobarColor xmobarCurrentWorkspaceColor ""
    , ppSep = " : "
    , ppLayout = xmobarColor "orange" ""
    -- , manageHook = manageDocks <+> myManageHook
    , manageHook = manageSpawn <+> manageDocks <+> myManageHook
    , startupHook = setWMName "LG3D"
    -- >> spawnHere "trayer --edge top --align left --SetDockType true --SetPartialStrut true --expand true --width 6 --transparent true --alpha 0 --tint 0x000000 --height 16"
    >> spawnHere "/usr/bin/xscreensaver -no-splash &"
    >> spawnHere "udiskie --tray &"
    >> spawnHere myBackground
    -- >> spawnHere "mpd"
    -- >> spawnOn "1:main" "/home/dvm/.xmonad/bin/nload.sh"
    -- >> spawnOn "1:main" "/home/dvm/.xmonad/bin/clock.sh"
    -- >> spawnOn "1:main" "/home/dvm/.xmonad/bin/visual.sh"
    -- >> spawnHere myTerminal
    -- >> spawnOn "2:www" myInternet
    -- >> spawnOn "3:office" myCalc
    -- >> spawnOn "4:rdp" "/home/dvm/.xmonad/bin/usrds006"
    -- >> spawnOn "5:editor" myEditor
    -- >> spawnOn "6:email" "evolution"
    -- >> spawnOn "7:files" "nautilus"
    -- >> spawnOn "9:WTL" myWTL
    -- Combine it all together
    -- A structure containing your configuration settings, overriding
    -- fields in the default config. Any you don't override, will
    -- use the defaults defined in xmonad/XMonad/Config.hs
    -- No need to modify this.
    defaults = defaultConfig {
    -- simple stuff
    terminal = myTerminal,
    focusFollowsMouse = myFocusFollowsMouse,
    borderWidth = myBorderWidth,
    modMask = myModMask,
    workspaces = myWorkspaces,
    normalBorderColor = myNormalBorderColor,
    focusedBorderColor = myFocusedBorderColor,
    -- key bindings
    keys = myKeys,
    mouseBindings = myMouseBindings,
    -- hooks, layouts
    layoutHook = smartBorders $ myLayout,
    manageHook = myManageHook,
    startupHook = myStartupHook
    Any input/insight would be greatly appreciated. Thank you for you time.
    Last edited by davama (2014-04-08 13:53:59)

    Awesome!!
    Skotish, thank you! I copied your code into my config and it worked like a charm. At first I thought they were identical so i  tried it with my code, since you mentioned watch for tabs and spaces. My block didn't work of course but I didn't understand why since "tabs and spaces" were identical. Until i put your block side by side with my block. Then i noticed the "$" was removed from:
    logHook = dynamicLogWithPP $ xmobarPP {
    I still dont understand Haskell much and what the "$" means but Im still learning.
    BTW my config has changed a bit so im going to post it (with pointer update included):
    import System.IO
    import System.Exit
    import XMonad
    import XMonad.Hooks.DynamicLog
    import XMonad.Hooks.ManageDocks
    import XMonad.Hooks.ManageHelpers
    import XMonad.Hooks.SetWMName
    import XMonad.Layout.Fullscreen
    import XMonad.Layout.NoBorders
    --import XMonad.Layout.Spiral
    import XMonad.Layout.Tabbed
    import XMonad.Layout.ThreeColumns
    import XMonad.Util.Run(spawnPipe)
    import XMonad.Util.EZConfig(additionalKeys)
    import qualified XMonad.StackSet as W
    import qualified Data.Map as M
    import XMonad.Actions.SpawnOn
    import XMonad.Actions.CycleWS
    import XMonad.Actions.PhysicalScreens
    import XMonad.Layout.Circle
    import XMonad.Actions.WindowBringer
    import XMonad.Layout.Cross
    import XMonad.Layout.Grid
    import XMonad.Layout.Minimize
    import XMonad.Layout.Maximize
    import XMonad.Actions.WindowMenu
    import XMonad.Actions.UpdatePointer
    -- FOR MULTIMEDIA KEYS RUN:
    -- xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
    -- Then look in /usr/include/X11/XF86keysym.h and look for the name and code.
    -- Terminal
    -- The preferred terminal program, which is used in a binding below and by
    -- certain contrib modules.
    myTerminal = "terminator"
    myInternet = "google-chrome-stable"
    myIM = "pidgin"
    myCalc = "libreoffice --calc"
    myEditor = "gedit"
    myBackground = "feh --bg-scale '/home/dvm/Pictures/infinity___widescreen_pack_by_morague.jpg'"
    myScreenshot = "scrot /home/dvm/Pictures/screen_%Y-%m-%d-%H-%M-%S.png -d 1"
    myMouseshot = "sleep 0.2; scrot -s ~/Pictures/screen_%Y-%m-%d-%H-%M-%S.png -d 1"
    myVirtual = "virtualbox"
    myRdesktop = "/home/dvm/.xmonad/bin/usrds006"
    myWTL = "/home/dvm/.xmonad/bin/wtl.sh"
    -- Workspaces
    -- The default number of workspaces (virtual screens) and their names.
    myWorkspaces = ["1:main","2:www","3:office","4:rdp","5:editor","6:email","7:files","8:chat","9:WTL"]
    -- Window rules
    -- Execute arbitrary actions and WindowSet manipulations when managing
    -- a new window. You can use this to, for example, always float a
    -- particular program, or have a client always appear on a particular
    -- workspace.
    -- To find the property name associated with a program, use
    -- > xprop | grep WM_CLASS
    -- and click on the client you're interested in.
    -- To match on the WM_NAME, you can use 'title' in the same way that
    -- 'className' and 'resource' are used below.
    myManageHook = composeAll
    [ resource =? "desktop_window" --> doIgnore
    , className =? "Galculator" --> doFloat
    , className =? "Steam" --> doFloat
    , className =? "Gimp" --> doFloat
    , resource =? "gpicview" --> doFloat
    , className =? "MPlayer" --> doFloat
    , className =? "Google-chrome-stable" --> doShift "2:www"
    , className =? "libreoffice-calc" --> doShift "3:office"
    , className =? "VirtualBox" --> doShift "3:office"
    , className =? "rdesktop" --> doShift "4:rdp"
    , className =? "Gedit" --> doShift "5:editor"
    , className =? "Evolution" --> doShift "6:email"
    , className =? "Nautilus" --> doShift "7:files"
    , className =? "Pidgin" --> doShift "8:chat"
    , className =? "Wine" --> doShift "9:WTL"
    , className =? "stalonetray" --> doIgnore
    , isFullscreen --> (doF W.focusDown <+> doFullFloat)]
    -- Layouts
    -- You can specify and transform your layouts by modifying these values.
    -- If you change layout bindings be sure to use 'mod-shift-space' after
    -- restarting (with 'mod-q') to reset your layout state to the new
    -- defaults, as xmonad preserves your old layout settings by default.
    -- The available layouts. Note that each layout is separated by |||,
    -- which denotes layout choice.
    myLayout = avoidStruts (
    Tall 1 (3/100) (1/2) |||
    Mirror (Tall 1 (3/100) (1/2)) |||
    tabbed shrinkText tabConfig |||
    Full |||
    Grid ||| -- This one is nice
    Circle ||| -- This and cross are similar but
    simpleCross) ||| -- cross sends focus window to center.
    -- spiral (6/7)) |||
    noBorders (fullscreenFull Full)
    -- Colors and borders
    -- Currently based on the ir_black theme.
    myNormalBorderColor = "#000000"
    myFocusedBorderColor = "#FF0000"
    -- Colors for text and backgrounds of each tab when in "Tabbed" layout.
    tabConfig = defaultTheme {
    activeBorderColor = "#FF0000",
    activeTextColor = "#CEFFAC",
    activeColor = "#000000",
    inactiveBorderColor = "#FF0000",
    inactiveTextColor = "#EEEEEE",
    inactiveColor = "#000000"
    -- Color of current window title in xmobar.
    xmobarTitleColor = "#00ff00"
    -- Color of current workspace in xmobar.
    xmobarCurrentWorkspaceColor = "#ee9a00"
    -- Width of the window border in pixels.
    myBorderWidth = 2
    -- Key bindings
    -- modMask lets you specify which modkey you want to use. The default
    -- is mod1Mask ("left alt"). You may also consider using mod3Mask
    -- ("right alt"), which does not conflict with emacs keybindings. The
    -- "windows key" is usually mod4Mask.
    myModMask = mod4Mask
    myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
    -- Custom key bindings
    -- Start a terminal. Terminal to start is specified by myTerminal variable.
    [ ((modMask .|. controlMask, xK_t), spawn $ XMonad.terminal conf)
    -- Launch remote desktop script
    , ((modMask .|. controlMask, xK_r), spawn myRdesktop)
    -- Launch Google Chrome
    , ((modMask .|. controlMask, xK_i), spawn myInternet)
    -- Launch Gedit
    , ((modMask .|. controlMask, xK_g), spawn myEditor)
    -- Launch Libreoffice Calc
    , ((modMask .|. controlMask, xK_c), spawn myCalc)
    -- Launch Virtualbox
    , ((modMask .|. controlMask, xK_v), spawn myVirtual)
    -- Launch Evolution Email Client
    , ((modMask .|. controlMask, xK_e), spawn "evolution")
    -- Launch WT Library
    , ((modMask .|. controlMask, xK_w), spawn myWTL)
    -- Launch nautilius File Manager
    , ((modMask .|. controlMask, xK_f), spawn "nautilus")
    -- display a number of actions related to window management in the center of the focused window.
    -- Actions include: Closing, maximizing, minimizing and shifting the window to another workspace.
    , ((modMask .|. shiftMask, xK_s), windowMenu)
    -- Pops open a dmenu with window titles. Choose one,
    -- and you will be taken to the corresponding workspace.
    , ((modMask .|. shiftMask, xK_g), gotoMenu)
    -- Pops open an application with window titles given
    -- over stdin. Choose one, and it will be dragged, kicking
    -- and screaming, into your current workspace.
    , ((modMask .|. shiftMask, xK_b), bringMenu)
    -- Lock the screen using xscreensaver. Using sleep button
    , ((0, 0x1008FF2F), spawn "xscreensaver-command -lock")
    -- Mute volume.
    -- , ((0, xK_F9), spawn "amixer -q set Master toggle")
    , ((0, 0x1008FF12), spawn "amixer -q set Master toggle")
    -- Decrease volume.
    -- , ((0, xK_F10), spawn "amixer -q set Master 10%-")
    , ((0, 0x1008FF11), spawn "amixer -q set Master 10%-")
    -- Increase volume.
    -- , ((0, xK_F11), spawn "amixer -q set Master 10%+")
    , ((0, 0x1008FF13), spawn "amixer -q set Master 10%+")
    -- Audio previous.
    , ((0, 0x1008FF16), spawn "ncmpcpp prev")
    -- Play/pause.
    , ((0, 0x1008FF14), spawn "ncmpcpp toggle")
    -- , ((0, 0x1008FF14), spawn "ncmpcpp stop; ncmpcpp play")
    -- Audio next.
    , ((0, 0x1008FF17), spawn "ncmpcpp next")
    -- Audio stop.
    , ((0, 0x1008FF15), spawn "ncmpcpp stop")
    -- Take full screenshot in multi-head mode.
    -- That is, take a screenshot of everything you see.
    -- , ((modMask .|. controlMask .|. shiftMask, xK_p), spawn "screenshot")
    , ((0, xK_Print), spawn myScreenshot)
    -- Take a screenshot in select mode.
    -- After pressing this key binding, click a window, or draw a rectangle with the mouse.
    , ((modMask, xK_Print), spawn myMouseshot)
    -- Run dmenu
    , ((modMask, xK_p), spawn "dmenu_run")
    -- Eject CD tray.
    , ((modMask, xK_F12), spawn "eject -T")
    -- Switch to Prev Xinerama
    , ((modMask, xK_Right), onPrevNeighbour W.view)
    -- Switch to Next Xinerama
    , ((modMask, xK_Left), onNextNeighbour W.view)
    -- Switch to Prev Workspace
    , ((modMask, xK_Down), moveTo Prev HiddenNonEmptyWS)
    -- Switch to Next Workspace
    , ((modMask, xK_Up), moveTo Next HiddenNonEmptyWS)
    -- Switch to next workspace
    , ((modMask, xK_Page_Up), moveTo Next HiddenWS)
    -- Switch to prev workspace
    , ((modMask, xK_Page_Down), moveTo Prev HiddenWS)
    -- "Standard" xmonad key bindings
    -- Close focused window.
    , ((modMask .|. shiftMask, xK_c), kill)
    -- Cycle through the available layout algorithms.
    , ((modMask, xK_space), sendMessage NextLayout)
    -- Reset the layouts on the current workspace to default.
    , ((modMask .|. shiftMask, xK_space), setLayout $ XMonad.layoutHook conf)
    -- Resize viewed windows to the correct size.
    , ((modMask, xK_n), refresh)
    -- Move focus to the next window.
    , ((modMask, xK_Tab), windows W.focusDown)
    -- Move focus to the next window.
    , ((modMask, xK_j), windows W.focusDown)
    -- Move focus to the previous window.
    , ((modMask, xK_k), windows W.focusUp )
    -- Move focus to the master window.
    , ((modMask, xK_m), windows W.focusMaster )
    -- Swap the focused window and the master window.
    , ((modMask, xK_Return), windows W.swapMaster)
    -- Swap the focused window with the next window.
    , ((modMask .|. shiftMask, xK_j), windows W.swapDown )
    -- Swap the focused window with the previous window.
    , ((modMask .|. shiftMask, xK_k), windows W.swapUp )
    -- Shrink the master area.
    , ((modMask, xK_h), sendMessage Shrink)
    -- Expand the master area.
    , ((modMask, xK_l), sendMessage Expand)
    -- Push window back into tiling.
    , ((modMask, xK_t), withFocused $ windows . W.sink)
    -- Increment the number of windows in the master area.
    , ((modMask, xK_comma), sendMessage (IncMasterN 1))
    -- Decrement the number of windows in the master area.
    , ((modMask, xK_period), sendMessage (IncMasterN (-1)))
    -- Toggle the status bar gap.
    -- TODO: update this binding with avoidStruts, ((modMask, xK_b),
    -- Quit xmonad.
    , ((modMask .|. shiftMask, xK_q), io (exitWith ExitSuccess))
    -- Restart xmonad.
    , ((modMask, xK_q), restart "xmonad" True)
    ++
    -- mod-[1..9], Switch to workspace N
    -- mod-shift-[1..9], Move client to workspace N
    [((m .|. modMask, k), windows $ f i)
    | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_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 .|. modMask, 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)]]
    -- Mouse bindings
    -- Focus rules
    -- True if your focus should follow your mouse cursor.
    myFocusFollowsMouse :: Bool
    myFocusFollowsMouse = True
    myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList $
    -- mod-button1, Set the window to floating mode and move by dragging
    ((modMask, button1),
    (\w -> focus w >> mouseMoveWindow w))
    -- mod-button2, Raise the window to the top of the stack
    , ((modMask, button2),
    (\w -> focus w >> windows W.swapMaster))
    -- Closed focus window. Modmask + Ctrl + Middle mouse button.
    , ((modMask .|. controlMask, button2), (\w -> focus w >> kill))
    -- mod-button3, Set the window to floating mode and resize by dragging
    , ((modMask, button3),
    (\w -> focus w >> mouseResizeWindow w))
    -- you may also bind events to the mouse scroll wheel (button4 and button5)
    -- mod-button4, Switch to next workspace
    , ((modMask, button4),
    (\w -> focus w >> moveTo Next HiddenNonEmptyWS))
    -- mod-button5, Switch to previous workspace
    , ((modMask, button5),
    (\w -> focus w >> moveTo Prev HiddenNonEmptyWS))
    -- Status bars and logging
    -- Perform an arbitrary action on each internal state change or X event.
    -- See the 'DynamicLog' extension for examples.
    -- To emulate dwm's status bar
    -- > logHook = dynamicLogDzen
    -- Startup hook
    -- Perform an arbitrary action each time xmonad starts or is restarted
    -- with mod-q. Used by, e.g., XMonad.Layout.PerWorkspace to initialize
    -- per-workspace layout choices.
    -- By default, do nothing.
    myStartupHook = return ()
    -- Run xmonad with all the defaults we set up.
    main = do
    xmproc <- spawnPipe "xmobar ~/.xmonad/xmobar.hs"
    xmonad $ defaults {
    logHook = dynamicLogWithPP xmobarPP {
    ppOutput = hPutStrLn xmproc
    , ppTitle = xmobarColor xmobarTitleColor "" . shorten 50
    , ppCurrent = xmobarColor xmobarCurrentWorkspaceColor ""
    , ppSep = " : "
    , ppLayout = xmobarColor "orange" ""
    >> updatePointer (TowardsCentre 0.99 0.99) -- moves pointer to center of focused window
    -- >> updatePointer (Relative 0.99 0.99) -- moves pointer to lower right corner of focused window
    -- , manageHook = manageDocks <+> myManageHook
    , manageHook = manageSpawn <+> manageDocks <+> myManageHook
    , startupHook = setWMName "LG3D"
    -- >> spawnHere "trayer --edge top --align left --SetDockType true --SetPartialStrut true --expand true --width 6 --transparent true --alpha 0 --tint 0x000000 --height 16"
    >> spawnHere "/usr/bin/xscreensaver -no-splash &"
    >> spawnHere "udiskie --tray &"
    >> spawnHere myBackground
    -- >> spawnHere "mpd"
    -- >> spawnOn "1:main" "/home/dvm/.xmonad/bin/nload.sh"
    -- >> spawnOn "1:main" "/home/dvm/.xmonad/bin/clock.sh"
    -- >> spawnOn "1:main" "/home/dvm/.xmonad/bin/visual.sh"
    -- >> spawnHere myTerminal
    -- >> spawnOn "2:www" myInternet
    -- >> spawnOn "3:office" myCalc
    -- >> spawnOn "4:rdp" "/home/dvm/.xmonad/bin/usrds006"
    -- >> spawnOn "5:editor" myEditor
    -- >> spawnOn "6:email" "evolution"
    -- >> spawnOn "7:files" "nautilus"
    -- >> spawnOn "9:WTL" myWTL
    -- Combine it all together
    -- A structure containing your configuration settings, overriding
    -- fields in the default config. Any you don't override, will
    -- use the defaults defined in xmonad/XMonad/Config.hs
    -- No need to modify this.
    defaults = defaultConfig {
    -- simple stuff
    terminal = myTerminal,
    focusFollowsMouse = myFocusFollowsMouse,
    borderWidth = myBorderWidth,
    modMask = myModMask,
    workspaces = myWorkspaces,
    normalBorderColor = myNormalBorderColor,
    focusedBorderColor = myFocusedBorderColor,
    -- key bindings
    keys = myKeys,
    mouseBindings = myMouseBindings,
    -- hooks, layouts
    layoutHook = smartBorders $ myLayout,
    manageHook = myManageHook,
    startupHook = myStartupHook
    Actually decided to use "TowardsCentre" instead.
    For anyone else reading this, i'm currently using xmonad v0.11 and xmobar v0.20.1
    Woa! Rayman just saw you updated the post. Thanks for the explanation! Going to have to sit on that one to reread it cuz it just went over my head. Thanks for updating. I'll try your suggestion too, looks cleaner.
    Thank you all for your time.
    -Dave

  • [solved] xmonad issue

    I'm trying to get it so that when I open a new program, it is set as the slave and not the master. I did this by putting "insertPosition Below Newer" into my manageHook, and it works well except this causes dialog boxes to be opened up behind the active window and I have to move the window in order to find them. A good example of this is in GIMP; when I go to open a file, the open file dialog box can't be seen because the main GIMP windowis blocking it. If I remove the insertPosition line, it goes back to normal. Is there anyway for me to make only new instances of urxvt to be inserted Below Newer? I tried className =? "urxvt" --> insertPosition Below Newer, but that didn't work.
    Edit: here's my entire xmonad.hs
    import XMonad
    import XMonad.Actions.GridSelect
    import XMonad.Hooks.DynamicLog -- statusbar
    import XMonad.Hooks.EwmhDesktops -- fullscreenEventHook fixes chrome fullscreen
    import XMonad.Hooks.ManageDocks -- dock/tray mgmt
    import XMonad.Hooks.ManageHelpers
    import XMonad.Hooks.UrgencyHook -- window alert bells
    import XMonad.Hooks.InsertPosition
    import XMonad.Layout.NoBorders
    import XMonad.Layout.ResizableTile
    import XMonad.Layout.Named
    import XMonad.Layout.Tabbed
    import XMonad.Layout.Spiral
    import XMonad.Util.Run(spawnPipe) -- spawnPipe and hPutStrLn
    import XMonad.Util.Cursor
    import System.IO -- hPutStrLn scope
    import System.Exit
    import qualified XMonad.StackSet as W -- manageHook rules
    import qualified Data.Map as M
    main = do
    status <- spawnPipe myDzenStatus -- xmonad status on the left
    conky <- spawnPipe myDzenConky -- conky stats on the right
    xmonad $ withUrgencyHook NoUrgencyHook $ defaultConfig
    { modMask = mod4Mask
    , terminal = "urxvtc"
    , borderWidth = 1
    , normalBorderColor = "#333333"
    , focusedBorderColor = "#AFAF97"
    , handleEventHook = fullscreenEventHook
    , workspaces = myWorkspaces
    , layoutHook = myLayoutHook
    , manageHook = manageDocks <+> myManageHook
    <+> manageHook defaultConfig
    , logHook = myLogHook status
    , keys = myKeys
    , startupHook = setDefaultCursor xC_left_ptr
    -- Tags/Workspaces
    -- clickable workspaces via dzen/xdotool
    myWorkspaces :: [String]
    myWorkspaces = clickable . (map dzenEscape) $ ["1-main","2-web","3-dev","4-games","5","6","7","8","9"]
    where clickable l = [ "^ca(1,xdotool key super+" ++ show (n) ++ ")" ++ ws ++ "^ca()" |
    (i,ws) <- zip [1..] l,
    let n = i ]
    -- Layouts
    -- the default layout is fullscreen with smartborders applied to all
    myLayoutHook = avoidStruts $ tile ||| mtile ||| fib ||| tab ||| full
    where
    rt = ResizableTall 1 (2/100) (1/2) []
    tile = named "[]=" $ smartBorders rt
    mtile = named "M[]=" $ smartBorders $ Mirror rt
    fib = named "[F]" $ smartBorders $ spiral (6/7)
    tab = named "T" $ noBorders $ tabbed shrinkText tabTheme1
    full = named "[]" $ noBorders Full
    -- Window management
    myManageHook = composeAll
    [ isFullscreen --> doFullFloat
    , isDialog --> doCenterFloat
    , className =? "MPlayer" --> doCenterFloat
    , className =? "Vlc" --> doCenterFloat
    , className =? "Gimp" --> doFloat
    --, insertPosition Below Newer
    , transience'
    -- tabs
    tabTheme1 = defaultTheme { decoHeight = 16
    , activeColor = "#a6c292"
    , activeBorderColor = "#a6c292"
    , activeTextColor = "#000000"
    , inactiveBorderColor = "#000000"
    -- Statusbar
    myLogHook h = dynamicLogWithPP $ myDzenPP { ppOutput = hPutStrLn h }
    cleanDzen = "killall dzen2"
    myDzenStatus = "dzen2 -w '500' -ta 'l'" ++ myDzenStyle
    myDzenConky = "conky -c ~/.xmonad/conkyrc | dzen2 -x '500' -w '866' -ta 'r'" ++ myDzenStyle
    myDzenStyle = " -h '20' -fg '#777777' -bg '#222222' -fn 'terminus:size=9'"
    myDzenPP = dzenPP
    { ppCurrent = dzenColor "#65ac35" "" . wrap "<" ">"
    , ppHidden = dzenColor "#f85708" "" . wrap " " " "
    , ppHiddenNoWindows = dzenColor "#a8a8a8" "" . wrap " " " "
    , ppUrgent = dzenColor "#18618f" "" . wrap "[" "]"
    , ppSep = dzenColor "#18618f" "" " | "
    , ppLayout = dzenColor "#65ac35" "" . wrap "^ca(1,xdotool key super+space)· " " ·^ca()"
    , ppTitle = dzenColor "#f85708" ""
    . wrap "^ca(1,xdotool key super+k)^ca(2,xdotool key super+shift+c)"
    " ^ca()^ca()" . shorten 20 . dzenEscape
    myGSConfig = defaultGSConfig { gs_cellwidth = 160 }
    -- Key bindings
    myModMask = mod4Mask
    secModMask = mod1Mask
    toggleStrutsKey :: XConfig Layout -> (KeyMask, KeySym)
    toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b)
    myKeys :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ())
    myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
    -- launching and killing programs
    [ ((modMask, xK_Return), spawn $ XMonad.terminal conf)
    , ((modMask, xK_r ), spawn "dmenu_run")
    , ((modMask, xK_d ), spawn "dwb")
    , ((modMask .|. shiftMask, xK_m ), spawn "claws-mail")
    , ((modMask .|. shiftMask, xK_c ), kill)
    , ((0, xK_Print), spawn "scrot '%Y-%m-%d-$wx$h.png' -e 'mv $f ~/pictures/screens/'")
    , ((modMask .|. secModMask, xK_space ), spawn "/home/bslackr/bin/toggletouchpad")
    -- grid
    , ((modMask, xK_g ), goToSelected myGSConfig)
    -- layouts
    , ((modMask, xK_space ), sendMessage NextLayout)
    , ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
    -- floating layer stuff
    , ((modMask, xK_t ), withFocused $ windows . W.sink)
    -- refresh
    , ((modMask, xK_n ), refresh)
    -- focus
    , ((modMask, xK_Tab ), windows W.focusDown)
    , ((modMask, xK_j ), windows W.focusDown)
    , ((modMask, xK_k ), windows W.focusUp)
    , ((modMask, xK_m ), windows W.focusMaster)
    -- swapping
    , ((modMask .|. shiftMask, xK_Return), windows W.swapMaster)
    , ((modMask .|. shiftMask, xK_j ), windows W.swapDown )
    , ((modMask .|. shiftMask, xK_k ), windows W.swapUp )
    -- increase or decrease number of windows in the master area
    , ((modMask , xK_comma ), sendMessage (IncMasterN 1))
    , ((modMask , xK_period), sendMessage (IncMasterN (-1)))
    -- resizing
    , ((modMask, xK_h ), sendMessage Shrink)
    , ((modMask, xK_l ), sendMessage Expand)
    , ((modMask .|. shiftMask, xK_h ), sendMessage MirrorShrink)
    , ((modMask .|. shiftMask, xK_l ), sendMessage MirrorExpand)
    -- brightness
    , ((0, 0x1008FF02), spawn "/home/bslackr/bin/bsetbacklight inc")
    , ((0, 0x1008FF03), spawn "/home/bslackr/bin/bsetbacklight dec")
    -- volume
    , ((0, 0x1008FF11), spawn "amixer set Master 10%-")
    , ((0, 0x1008FF12), spawn "amixer set Master toggle")
    , ((0, 0x1008FF13), spawn "amixer set Master 10%+")
    -- quit, or restart
    , ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
    , ((modMask , xK_q ), spawn "xmonad --recompile; killall dzen2; xmonad --restart")
    ++
    -- mod-[1..9] %! Switch to workspace N
    -- mod-shift-[1..9] %! Move client to workspace N
    [((m .|. modMask, k), windows import XMonad
    import XMonad.Actions.GridSelect
    import XMonad.Hooks.DynamicLog -- statusbar
    import XMonad.Hooks.EwmhDesktops -- fullscreenEventHook fixes chrome fullscreen
    import XMonad.Hooks.ManageDocks -- dock/tray mgmt
    import XMonad.Hooks.ManageHelpers
    import XMonad.Hooks.UrgencyHook -- window alert bells
    import XMonad.Hooks.InsertPosition
    import XMonad.Layout.NoBorders
    import XMonad.Layout.ResizableTile
    import XMonad.Layout.Named
    import XMonad.Layout.Tabbed
    import XMonad.Layout.Spiral
    import XMonad.Util.Run(spawnPipe) -- spawnPipe and hPutStrLn
    import XMonad.Util.Cursor
    import System.IO -- hPutStrLn scope
    import System.Exit
    import qualified XMonad.StackSet as W -- manageHook rules
    import qualified Data.Map as M
    main = do
    status <- spawnPipe myDzenStatus -- xmonad status on the left
    conky <- spawnPipe myDzenConky -- conky stats on the right
    xmonad $ withUrgencyHook NoUrgencyHook $ defaultConfig
    { modMask = mod4Mask
    , terminal = "urxvtc"
    , borderWidth = 1
    , normalBorderColor = "#333333"
    , focusedBorderColor = "#AFAF97"
    , handleEventHook = fullscreenEventHook -- Only in darcs xmonad-contrib
    , workspaces = myWorkspaces
    , layoutHook = myLayoutHook
    , manageHook = manageDocks <+> myManageHook
    <+> manageHook defaultConfig
    , logHook = myLogHook status
    , keys = myKeys
    , startupHook = setDefaultCursor xC_left_ptr
    -- Tags/Workspaces
    -- clickable workspaces via dzen/xdotool
    myWorkspaces :: [String]
    myWorkspaces = clickable . (map dzenEscape) $ ["1-main","2-web","3-dev","4-games","5","6","7","8","9"]
    where clickable l = [ "^ca(1,xdotool key super+" ++ show (n) ++ ")" ++ ws ++ "^ca()" |
    (i,ws) <- zip [1..] l,
    let n = i ]
    -- Layouts
    -- the default layout is fullscreen with smartborders applied to all
    myLayoutHook = avoidStruts $ tile ||| mtile ||| fib ||| tab ||| full
    where
    rt = ResizableTall 1 (2/100) (1/2) []
    tile = named "[]=" $ smartBorders rt
    mtile = named "M[]=" $ smartBorders $ Mirror rt
    fib = named "[F]" $ smartBorders $ spiral (6/7)
    tab = named "T" $ noBorders $ tabbed shrinkText tabTheme1
    full = named "[]" $ noBorders Full
    -- Window management
    myManageHook = composeAll
    [ isFullscreen --> doFullFloat
    , isDialog --> doCenterFloat
    , className =? "MPlayer" --> doCenterFloat
    , className =? "Vlc" --> doCenterFloat
    , className =? "Gimp" --> doFloat
    --, insertPosition Below Newer
    , transience'
    -- tabs
    tabTheme1 = defaultTheme { decoHeight = 16
    , activeColor = "#a6c292"
    , activeBorderColor = "#a6c292"
    , activeTextColor = "#000000"
    , inactiveBorderColor = "#000000"
    -- Statusbar
    myLogHook h = dynamicLogWithPP $ myDzenPP { ppOutput = hPutStrLn h }
    cleanDzen = "killall dzen2"
    myDzenStatus = "dzen2 -w '500' -ta 'l'" ++ myDzenStyle
    myDzenConky = "conky -c ~/.xmonad/conkyrc | dzen2 -x '500' -w '866' -ta 'r'" ++ myDzenStyle
    myDzenStyle = " -h '20' -fg '#777777' -bg '#222222' -fn 'terminus:size=9'"
    myDzenPP = dzenPP
    { ppCurrent = dzenColor "#65ac35" "" . wrap "<" ">"
    , ppHidden = dzenColor "#f85708" "" . wrap " " " "
    , ppHiddenNoWindows = dzenColor "#a8a8a8" "" . wrap " " " "
    , ppUrgent = dzenColor "#18618f" "" . wrap "[" "]"
    , ppSep = dzenColor "#18618f" "" " | "
    , ppLayout = dzenColor "#65ac35" "" . wrap "^ca(1,xdotool key super+space)· " " ·^ca()"
    , ppTitle = dzenColor "#f85708" ""
    . wrap "^ca(1,xdotool key super+k)^ca(2,xdotool key super+shift+c)"
    " ^ca()^ca()" . shorten 20 . dzenEscape
    myGSConfig = defaultGSConfig { gs_cellwidth = 160 }
    -- Key bindings
    myModMask = mod4Mask
    secModMask = mod1Mask
    toggleStrutsKey :: XConfig Layout -> (KeyMask, KeySym)
    toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b)
    myKeys :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ())
    myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $
    -- launching and killing programs
    [ ((modMask, xK_Return), spawn $ XMonad.terminal conf)
    , ((modMask, xK_r ), spawn "dmenu_run")
    , ((modMask, xK_d ), spawn "dwb")
    , ((modMask .|. shiftMask, xK_m ), spawn "claws-mail")
    , ((modMask .|. shiftMask, xK_c ), kill)
    , ((0, xK_Print), spawn "scrot '%Y-%m-%d-$wx$h.png' -e 'mv $f ~/pictures/screens/'")
    , ((modMask .|. secModMask, xK_space ), spawn "/home/bslackr/bin/toggletouchpad")
    -- grid
    , ((modMask, xK_g ), goToSelected myGSConfig)
    -- layouts
    , ((modMask, xK_space ), sendMessage NextLayout)
    , ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf)
    -- floating layer stuff
    , ((modMask, xK_t ), withFocused $ windows . W.sink)
    -- refresh
    , ((modMask, xK_n ), refresh)
    -- focus
    , ((modMask, xK_Tab ), windows W.focusDown)
    , ((modMask, xK_j ), windows W.focusDown)
    , ((modMask, xK_k ), windows W.focusUp)
    , ((modMask, xK_m ), windows W.focusMaster)
    -- swapping
    , ((modMask .|. shiftMask, xK_Return), windows W.swapMaster)
    , ((modMask .|. shiftMask, xK_j ), windows W.swapDown )
    , ((modMask .|. shiftMask, xK_k ), windows W.swapUp )
    -- increase or decrease number of windows in the master area
    , ((modMask , xK_comma ), sendMessage (IncMasterN 1))
    , ((modMask , xK_period), sendMessage (IncMasterN (-1)))
    -- resizing
    , ((modMask, xK_h ), sendMessage Shrink)
    , ((modMask, xK_l ), sendMessage Expand)
    , ((modMask .|. shiftMask, xK_h ), sendMessage MirrorShrink)
    , ((modMask .|. shiftMask, xK_l ), sendMessage MirrorExpand)
    -- brightness
    , ((0, 0x1008FF02), spawn "/home/bslackr/bin/bsetbacklight inc")
    , ((0, 0x1008FF03), spawn "/home/bslackr/bin/bsetbacklight dec")
    -- volume
    , ((0, 0x1008FF11), spawn "amixer set Master 10%-")
    , ((0, 0x1008FF12), spawn "amixer set Master toggle")
    , ((0, 0x1008FF13), spawn "amixer set Master 10%+")
    -- quit, or restart
    , ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess))
    , ((modMask , xK_q ), spawn "xmonad --recompile; killall dzen2; xmonad --restart")
    ++
    -- mod-[1..9] %! Switch to workspace N
    -- mod-shift-[1..9] %! Move client to workspace N
    [((m .|. modMask, k), windows $ f i)
    | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
    , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
    ++
    -- mod-[w,e] %! switch to twinview screen 1/2
    -- mod-shift-[w,e] %! move window to screen 1/2
    [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
    | (key, sc) <- zip [xK_w, xK_e] [0..]
    , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
    -- vim:sw=4 sts=4 ts=4 tw=0 et ai
    $ f i)
    | (i, k) <- zip (XMonad.workspaces conf) [xK_1 .. xK_9]
    , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
    ++
    -- mod-[w,e] %! switch to twinview screen 1/2
    -- mod-shift-[w,e] %! move window to screen 1/2
    [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f))
    | (key, sc) <- zip [xK_w, xK_e] [0..]
    , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
    -- vim:sw=4 sts=4 ts=4 tw=0 et ai
    Last edited by bslackr (2012-03-20 21:37:04)

    I use avoidMaster from the xmonad FAQ to do this. Mine is a little modified though.
    http://www.haskell.org/haskellwiki/Xmon … s_normally
    Here's the relevent parts from my xmonad.hs as well:
    myManageHook = composeOne . concat $
    [ [ title =? c -?> doF (avoidMaster) | c <- myAMTitle ]
    where
    myAMTitle = ["xterm", "urxvt", "mrxvt", "gnome-terminal", "Gnome-terminal"]
    -- here's the part from the xmonad faq
    avoidMaster :: W.StackSet i l a s sd -> W.StackSet i l a s sd
    avoidMaster = W.modify' $ \c -> case c of
    W.Stack t [] (r:rs) -> W.Stack t [r] rs
    otherwise -> c
    Hope that helps
    Last edited by vernonrj (2012-03-20 04:19:49)

  • [SOLVED]Xmonad bitmap workspace names not working?

    I don't have a great deal of space on my screen, so I thought I'd save some by using icons instead of names for my workspaces. I have written my xmonad.hs as closely to every example I've found without redoing my entire xmonad.hs and it still puts '^p(5)^i(/home/nfarley88/.dzenicons/terminal.xbm)^p(5)' instead of the actual bitmap for the workspace title!
    import XMonad
    import XMonad.Prompt
    import XMonad.Prompt.Shell
    import XMonad.Prompt.Man
    import XMonad.Hooks.DynamicLog
    import XMonad.Hooks.ManageDocks
    import XMonad.Util.Run(spawnPipe)
    import XMonad.Util.EZConfig
    import XMonad.Hooks.UrgencyHook
    import XMonad.Layout
    import XMonad.Layout.Grid
    import XMonad.Layout.Accordion
    import XMonad.Layout.Tabbed
    import XMonad.Layout.PerWorkspace
    import XMonad.Layout.NoBorders
    import XMonad.Layout.IM
    import XMonad.Layout.Named
    import XMonad.Actions.CycleWS
    import XMonad.Actions.MouseGestures
    import qualified XMonad.StackSet as W
    import qualified Data.Map as M
    import Data.Ratio ((%))
    import Graphics.X11.Xlib
    --import XMonad.Actions.NoBorders
    import System.IO
    fgColor = "#FF0000"
    bgColor = "#000000"
    wrapBitmap bitmap = "^p(5)^i(" ++ myBitmapsPath ++ bitmap ++ ")^p(5)"
    w1 = wrapBitmap ".dzenicons/terminal.xbm"
    w2 = wrapBitmap ".dzenicons/terminal.xbm"
    w3 = wrapBitmap ".dzenicons/terminal.xbm"
    terminality = (myWorkspaces !! 0)
    internet = (myWorkspaces !! 1)
    instantmessaging = (myWorkspaces !! 2)
    myWorkspaces :: [String]
    myBitmapsPath = "/home/nfarley88/"
    myWorkspaces = clickable . (map dzenEscape) $ [ w1, w2, w3 ]
    where clickable l = [ "^ca(1,xdotool key super+" ++ show (n) ++ ")" ++ ws ++ "^ca()" |
    (i,ws) <- zip [1..] l,
    let n = i ]
    wrapBitmap bitmap = "^p(5)^i(" ++ myBitmapsPath ++ bitmap ++ ")^p(5)"
    myManageHook = composeAll
    [ className =? "Chromium" --> doShift internet
    , className =? "Firefox" --> doShift internet
    , className =? "Pidgin" --> doShift instantmessaging
    --, appName =? "Buddy List" --> doFloat
    --, manageDocks
    myLayoutHookinternet = named "Tabbed" (noBorders tabs)
    ||| noBorders Full
    ||| Mirror tiled
    ||| tiled
    where
    tabs = tabbedBottom shrinkText oxyDarkTheme
    -- default tiling algorithm partitions the screen into two panes
    tiled = Tall nmaster delta ratio -- see how there's 3 arguments to "Tall"
    -- 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
    oxyDarkTheme = defaultTheme { inactiveBorderColor = "#aaaaaa"
    , activeBorderColor = "#000000"
    , activeColor = "#000"
    , inactiveColor = "#000000"
    , inactiveTextColor = "#aaaaaa"
    , activeTextColor = "red"
    , fontName = "xft:nu-8"
    , decoHeight = 8
    , urgentColor = "#ffff00"
    , urgentTextColor = "#63b8ff"
    myLayoutHook = avoidStruts $ terminal $ www $ instantmessage $ layoutHook defaultConfig
    where
    terminal = onWorkspace terminality ( Grid ||| Full)
    www = onWorkspace (myWorkspaces !! 1) ( avoidStruts $ myLayoutHookinternet )
    instantmessage = onWorkspace instantmessaging (withIM (1%7) sidepanel (Mirror (GridRatio (1/1))))
    where
    sidepanel = (ClassName "Pidgin") `And` (Role "buddy_list") `And` (Not (Role "convsersation")) --(Title "Buddy List")
    myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $
    [ ((modm, button1), (\w -> focus w >> mouseMoveWindow w
    >> windows W.shiftMaster))
    , ((modm, button2), (\w -> focus w >> windows W.shiftMaster))
    , ((modm, button3), (\w -> focus w >> mouseResizeWindow w
    >> windows W.shiftMaster))
    myStatusBar = "dzen2 -x '0' -y '0' -h '16' -w '590' -ta 'l' -fg '#FFFFFF' -bg '#000000' -fn '-misc-fixed-*-*-*-*-12-*-*-*-*-*-*-*'"
    conkyStatsBar = "conky -c .conkyrc_console | dzen2 -x '590' -y '0' -h '16' -w '485' -ta 'r' -fg '#FFFFFF' -bg '#000000' -fn '-misc-fixed-*-*-*-*-12-*-*-*-*-*-*-*'"
    conkyClockBar = "conky -c .conkyrc_clock | dzen2 -x '1075' -y '0' -h '16' -w '120' -ta 'r' -fg '#FFFFFF' -bg '#000000' -fn '-misc-fixed-*-*-*-*-12-*-*-*-*-*-*-*'"
    myLogHook h = defaultPP
    ppCurrent = wrapFgBg "#3EB5FF" "black" -- . pad
    --, ppVisible = dzenColor "white" "black" . pad
    --, ppHidden = dzenColor "white" "black" . pad
    --, ppHiddenNoWindows = dzenColor "#444444" "black" . pad
    , ppUrgent = wrapBg myUrgentWsBgColor--dzenColor "red" "yellow" -- . pad
    , ppWsSep = "^bg(" ++ myBgBgColor ++ ")^r(1,15)^bg()"
    , ppSep = " | "
    , ppTitle = (\x -> " " ++ wrapFg myTitleFgColor x) --("" ++) . dzenColor "white" "black" . dzenEscape
    , ppOutput = hPutStrLn h
    where
    wrapFgBg fgColor bgColor content= wrap ("^fg(" ++ fgColor ++ ")^bg(" ++ bgColor ++ ")") "^fg()^bg()" content
    wrapFg color content = wrap ("^fg(" ++ color ++ ")") "^fg()" content
    wrapBg color content = wrap ("^bg(" ++ color ++ ")") "^bg()" content
    wrapBitmap bitmap = "^p(5)^i(" ++ myBitmapsPath ++ bitmap ++ ")^p(5)"
    myTitleFgColor = "#FF0000"
    myBgBgColor = "#00FF00"
    myUrgentWsBgColor = "#00FF00"
    main = do
    --xmproc <- spawnPipe "/usr/bin/xmobar /home/nfarley88/.xmobarrc"
    workspaceBar <- spawnPipe myStatusBar
    spawn conkyStatsBar
    spawn conkyClockBar
    xmonad $ withUrgencyHook NoUrgencyHook $ defaultConfig
    { --workspaces = ["terminality", "internet", "IM", "4", "5", "6", "7", "8"]
    workspaces = myWorkspaces
    , manageHook = manageDocks <+> myManageHook <+> manageHook defaultConfig
    , layoutHook = myLayoutHook
    , logHook = dynamicLogWithPP $ myLogHook workspaceBar
    , modMask = mod4Mask --rebind Mod to the Windows key
    , terminal = "urxvt"
    , focusedBorderColor = "#000000"
    --, mouseBindings = myMouseBindings
    } --`additionalMouseBinding`
    --[ ((mod4Mask .|. shiftMask, button3), mouseGesture gestures)
    `additionalKeys`
    [ ((mod4Mask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock")
    , ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
    , ((0, xK_Print), spawn "scrot")
    , ((mod4Mask, xK_u), focusUrgent )
    , ((mod4Mask , xK_b ), sendMessage ToggleStruts)
    , ((mod4Mask .|. shiftMask, xK_r), spawn "killall conky dzen2 && xmonad --recompile && xmonad --restart")
    -- Application launching keys
    , ((mod4Mask , xK_p ), spawn "dmenu_run")
    , ((mod4Mask , xK_g ), spawn "chromium")
    , ((mod4Mask , xK_f ), spawn "firefox")
    , ((mod4Mask , xK_i ), spawn "pidgin")
    ] `additionalKeysP`
    [ ("<XF86Calculator>", toggleWS)
    The conky dzen has icons working. I cannot understand why it's not working!
    Any help would be greatly appreciated.
    PS some of the options are a bit strange (colour choices and such); I have some odd ones so I know what affects what.
    Last edited by Rubbishbook (2011-08-20 00:15:52)

    I've fixed it! A combination of https://bbs.archlinux.org/viewtopic.php?id=108968 and http://pastebin.com/hXD9YDRW. For reference, here are the bits that changed:
    myWorkspaces :: [String]
    myBitmapsPath = "/home/nfarley88/"
    myWorkspaces = clickable $ [ " ^i(/home/nfarley88/.dzenicons/terminal.xbm) ", " ^i(/home/nfarley88/.dzenicons/internet.xbm) ", " ^i(/home/nfarley88/.dzenicons/im.xbm) " ]
    where clickable l = [ "^ca(1,xdotool key super+" ++ show (n) ++ ")" ++ ws ++ "^ca()" |
    (i,ws) <- zip [1..] l,
    let n = i ]
    wrapBitmap bitmap = "^p(5)^i(" ++ myBitmapsPath ++ bitmap ++ ")^p(5)"
    and
    myLogHook h = defaultPP
    { ppOutput = hPutStrLn h
    , ppSep = ""
    , ppWsSep = ""
    , ppCurrent = wrap "^fg(#ffffff)^bg(#60a0c0)" "^fg()^bg()"
    , ppUrgent = wrap "^fg(#ffffff)^bg(#aff73e)" "^fg()^bg()"
    , ppVisible = wrap "^fg(#b8bcb8)^bg(#484848)" "^fg()^bg()"
    , ppHidden = wrap "^fg(#b8bcb8)^bg(#484848)" "^fg()^bg()"
    , ppHiddenNoWindows = wrap "^fg(#484848)^bg(#000000)" "^fg()^bg()"
    , ppTitle = wrap "^fg(#9d9d9d)^bg(#000000)" "^fg()^bg()" . wrap "" " ^fg(#a488d9)>^fg(#60a0c0)>^fg(#444444)>"
    , ppLayout = wrap "^fg(#60a0c0)^bg(#000000)" "^fg()^bg()"

  • [SOLVED] Xmonad: trasparency doesn't work with compton intel

    Dear All,
    I am having a strange issue with Xmonad and I am not sure whether it is a problem of my Arch or Xmonad configuration. I decided to ask on Arch forum first, as my other computer running Arch has exactly the same Xmonad setup and it works fine. I would appreciate assistance from some Xmonad or Arch proficient users on this.
    Basically, I have this piece of code in my xmonad.hs:
    myLogHook :: Handle -> X ()
    , logHook = myLogHook dzenLeftBar >> fadeInactiveLogHook 0.8
    On the other computer this makes all the unfocused windowses slightly transparent. I find this feature very useful as it helps me focus on the window I am working with.
    For some reason this doesn't work on my laptop. My laptop is using xf86-video-intel since the lspci gave me
    %lspci | grep VGA
    00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primary) (rev 03)
    Also I am invoking compton-git from AUR but I have also tried with xcompmgr in my xinitrc and it gave exactly the same result - no transparency whatsoever.
    I looked through my log file, but couldn't find anything relevant (please let me know if you can think of anything). How do I proceed with this issue? Do I try different composite managers? Do I try different drivers? Is there anyhting in X setup that I should include? Please let me know if you have any ideas.
    Last edited by AlmostSurelyRob (2013-06-18 10:18:08)

    I am very sorry. I've just discovered that neither compton nor xcompmgr were installed. It's not only solved, it should be marked as [NOT RAISED]. I was migrating my configuration and overlooked some erm... details.

  • [Solved] i3 workspace output woes

    Semi-recently switched to i3, loving everything about it so far other than one fairly large issue that is stopping me using it like a true WM.
    Basically, I'm trying to set 4 workspaces on each monitor (of which I have 2), and it just straight up doesn't work. Both outputs have at least 8 (I only have 1-8 switch keys bound) workspaces that are independent, and if I launch applications before switching, they get ignored and other workspaces get created.
    My .i3 config
    My xorg.conf
    Output of xrandr
    An example of what I mean about it ignoring the preset workspaces.
    Happy to post anything else needed, thanks!
    Last edited by elken (2014-02-07 08:24:40)

    I took a break from i3 for a day as this was really bugging me, had a sleep, woke up this morning and I've sorted it. It's a very hacked solution, but it does the job. Instead of having
    bindsym $mod4+<num> workspace <num>
    I now have
    bindsym $mod4+<num> exec "i3-msg focus output <monitor>; i3-msg workspace <num>"
    Which I know will probably cause problems later, but it does the job for now. Marking as solved.

  • XMonad - workspace order issue

    Hi,
    I'm trying to fix a minor issue/annoyance with my XMonad configuration but could use some help.
    I have 3 monitors connected to the one card.  Two DVI connectors and one HDMI.  Xorg pretty much worked out-the-box, except the screens were logically in the wrong order in relation the their positioning.  When moving the mouse, the order would be as shown below:
    [2] [1*] [3]
    * = denotes the middle monitor should be the primary display (HDMI).
    I fixed that with the below command first.  Then later with /etc/X11/xorg.conf.
    xrandr --output HDMI-0 --auto --primary --output DVI-D-0 --right-of HDMI-0 --output DVI-I-1 --left-of HDMI-0
    That was fine but the XMonad {w,e,r} key bindings were also in the wrong order.  I fixed that with the following in my ~/.xmonad/xmonad.hs configuration.
    [((m .|. mod4Mask, key), screenWorkspace sc >>= flip whenJust (windows . f))
    | (key, sc) <- zip [xK_w, xK_e, xK_r] [1,0,2] -- was [0..]
    , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]
    Now the only issue is that when XMonad starts, it defaults to use the middle monitor (which is correct) but xmobar reports the below.
    [1:web1] (2:web2) (3:games)
    Where the middle monitor is mapped to the [1:web1] workspace.
    What I'm trying to achieve is so that it defaults to:
    (1:web1) [2:web2] (3:games)
    Where the middle monitor is mapped to the [2:web2] workspace.
    I know all this stuff is very fluid in XMonad and so not really an issue......it's just seems a more logical way to start the session.
    Surely this is possible isn't it?!

    You probably mean restart instead of recompile and yes the startupHook runs during every startup (see name and documentation of XConfig). I can't think of an easy way to get around that, but it'll probably be a little less annoying if you always switch to your main screen during startup (to make it independent of the screen you're on at the time you issue the restart command).
    You currently specify the order twice: once for xrandr and once for the keybindings. I found http://xmonad.org/xmonad-docs/xmonad-co … reens.html, which you can use to make the keybindings follow the order specified with xrandr. Then if you reorder the monitors, you only have to adjust the xrandr command. And it gives you viewScreen to use in the startupHook instead of the stuff from CycleWS. Then you get
    import XMonad.Actions.PhysicalScreens
    myStartupHook = setWMName "LG3D" >> viewScreen 1
    (+ the keybindings from the example in the documentation). This also shows that you can combine actions with >> (do-notation could also be used instead).
    Last edited by Raynman (2014-04-08 20:59:25)

  • [SOLVED] XMonad + dzen2

    I have been staring at this for the last day and I can't figure out why it isn't working.  I cannot for the life of me get topBarCmd or botBarCmd to show up; I pretty much copied these configs from one of my working systems, and just edited them for a different monitor size. 
    Relevant XMonad section:
    -- dzen config
    sBarCmd = "dzen2 -fn '-*-times-*-r-*-*-12-*-*-*-*-*-*-*' -bg '#000000' -fg '#ffffff' -h 16 -w 840 -ta l"
    topBarCmd = "conky -c ~/.conkyrc | dzen2 -fn '-*-times-*-r-*-*-12-*-*-*-*-*-*-*' -bg '#000000' -fg '#ffffff' -h 16 -w 840 -x 841 -ta r"
    botBarCmd = "conky -c ~/.conky_bottom_dzen | dzen2 -fn '-*-times-*-r-*-*-12-*-*-*-*-*-*-*' -bg '#000000' -fg '#ffffff' -h 16 -y 1034 -w 1680 -ta c"
    sBarCmd shows, but the other two don't.  Any ideas?
    Last edited by lifeafter2am (2009-08-10 21:49:15)

    Well yeah, I know that. 
    Here is the whole config though.
    import XMonad
    import XMonad.Hooks.DynamicLog
    import XMonad.Hooks.ManageDocks
    import XMonad.Util.Run(spawnPipe)
    import XMonad.Util.EZConfig(additionalKeys)
    import System.IO
    import qualified XMonad.StackSet as W
    -- layouts
    import XMonad.Layout
    import XMonad.Layout.IM
    import XMonad.Layout.ToggleLayouts
    import XMonad.Layout.Reflect
    import XMonad.Layout.Combo
    import XMonad.Layout.Grid
    import XMonad.Layout.ResizableTile
    import Data.Ratio ((%))
    import XMonad.Layout.Gaps
    -- layout definitions
    customLayout = gaps [(D,16)] $ avoidStruts $ ResizableTall 2 (3/100) (1/2) [] ||| withIM (1%7) (ClassName "Buddy List") Grid ||| layoutHook defaultConfig
    -- Workspaces
    myWorkspaces = ["1:term","2:www","3:art","4:irc","5:media","6:im","7","8","9"]
    -- Window rules
    myManageHook = composeAll
    [className =? "wicd-client" --> doFloat
    ,className =? "xine" --> doFloat
    -- icons directory
    myBitmapsDir = "/home/ishikawa/.dzen"
    -- main config
    main = do
    dzenSbar <- spawnPipe sBarCmd
    dzenConkyTop <- spawnPipe topBarCmd
    dzenConkyBot <- spawnPipe botBarCmd
    spawn "xcompmgr"
    xmonad $ defaultConfig
    { manageHook = manageDocks <+> manageHook defaultConfig
    , terminal = "urxvt"
    , workspaces = myWorkspaces
    , borderWidth = 0
    , normalBorderColor = "#000000"
    , focusedBorderColor = "#3399ff"
    , layoutHook = customLayout
    , logHook = dynamicLogWithPP $ myDzenPP dzenSbar
    , modMask = mod4Mask -- Rebind Mod to the Windows key
    } `additionalKeys`
    ([ ((mod4Mask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock")
    , ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
    , ((0, xK_Print), spawn "scrot")
    , ((mod4Mask, xK_a), sendMessage MirrorShrink)
    , ((mod4Mask, xK_z), sendMessage MirrorExpand)
    ++
    -- mod-[1..9], Switch to workspace N
    -- mod-shift-[1..9], Move client to workspace N
    [((m .|. mod4Mask, k), windows $ f i)
    | (i, k) <- zip (myWorkspaces) [xK_1 .. xK_9]
    , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]])
    -- dzen config
    sBarCmd = "dzen2 -fn '-*-times-*-r-*-*-12-*-*-*-*-*-*-*' -bg '#000000' -fg '#ffffff' -h 16 -w 840 -ta l"
    topBarCmd = "conky -c /home/ishikawa/.conkyrc | dzen2 -fn '-*-times-*-r-*-*-12-*-*-*-*-*-*-*' -bg '#000000' -fg '#ffffff' -h 16 -w 840 -x 841 -ta r"
    botBarCmd = "conky -c ~/.conky_bottom_dzen | dzen2 -fn '-*-times-*-r-*-*-12-*-*-*-*-*-*-*' -bg '#000000' -fg '#ffffff' -h 16 -y 1034 -w 1680 -ta c"
    myDzenPP dzenSbar = defaultPP
    { ppCurrent = wrap "^p()[^fg(#346855)" "^fg()]^p()"
    , ppUrgent = wrap "!^fg(purple)^p()" "^fg()^p()"
    , ppVisible = wrap "^p()[^fg()" "^fg()]^p()"
    , ppTitle = wrap "^fg(#346855)< ^fg(#3a6b7a)" "^fg(#346855) >^fg()" . shorten 90
    , ppSep = " : "
    , ppWsSep = " : "
    , ppLayout = dzenColor "#346855" "#000000" .
    (\x -> case x of
    "Tall" -> "^i(" ++ myBitmapsDir ++ "/tall.xbm)"
    "Mirror Tall" -> "^i(" ++ myBitmapsDir ++ "/mtall.xbm)"
    "Full" -> "^i(" ++ myBitmapsDir ++ "/full.xbm)"
    "ResizableTall" -> "^i(" ++ myBitmapsDir ++ "/resizableGrid.xbm)"
    "IM Grid" -> "^i(" ++ myBitmapsDir ++ "/im-layout.xbm)"
    _ -> x
    , ppOutput = hPutStrLn dzenSbar
    Here are my conky's if they help too:
    conkyrc:
    # Set to yes if you want Conky to be forked in the background
    background no
    out_to_console yes
    # Update interval in seconds
    update_interval 1
    color1 ef89bb
    TEXT
    ^fg(#7ebdfc)| ^i(/home/ishikawa/.dzen/cpu.xbm) ^fg(#346855)${cpu cpu1}% ^fg(#7ebdfc) ^i(/home/ishikawa/.dzen/cpu.xbm) ^fg(#346855)${cpu cpu2}% @ $freq_g GHz ^fg(#7ebdfc)| ^i(/home/ishikawa/.dzen/mem.xbm) ^fg(#346855)$mem/$memmax ^fg(#7ebdfc)| ^i(/home/ishikawa/.dzen/net_down.xbm) ^fg(#346855)${downspeed eth1}/${totaldown eth1} ^fg(#7ebdfc)^i(/home/ishikawa/.dzen/net_up.xbm) ^fg(#346855)${upspeed eth1}/${totalup eth1} ^fg(#7ebdfc)| ^i(/home/ishikawa/.dzen/clock.xbm) ^fg(#346855)${time} ^fg(#7ebdfc)|
    conky_bottom_dzen:
    # Set to yes if you want Conky to be forked in the background
    background no
    out_to_console yes
    # Update interval in seconds
    update_interval 1
    # MPD host/port
    mpd_host localhost
    mpd_port 6600
    TEXT
    ^fg(#3a6b7a)| ^i(/home/ishikawa/.dzen/net_up_03.xbm) ^fg(#346855)$uptime ^fg(#3a6b7a)| ^fg(#1994d1) ^i(/home/ishikawa/.dzen/arch.xbm) ^fg(#346855)${texeci 1500 perl /home/ishikawa/scripts/xyne-update-checker.pl} ^fg(#3a6b7a)| ^i(/home/ishikawa/.dzen/diskette.xbm) ^fg(#346855)${fs_used sda4}/${fs_size sda4} ^fg(#3a6b7a)|^fg(#3a6b7a)| ^i(/home/ishikawa/.dzen/note.xbm) ^fg(#346855)$mpd_status : ${mpd_smart 50} ($mpd_elapsed / $mpd_length) ^fg(#3a6b7a)||
    As I said, this config works on two other systems, so I am stumped as to why it won't work on this one.

  • [SOLVED] Xmonad and two dzen2 bars

    Solved, thanks!
    Last edited by camphor (2010-03-02 07:01:35)

    Here is the relevant part of my xmonad.hs; these two bars load next to each other
    -- dzen config
    sBarCmd = "dzen2 -fn '-*-times-medium-r-*-*-*-*-*-*-*-*-*-*' -bg '#000000' -fg '#ffffff' -h 16 -w 500 -ta l"
    topBarCmd = "conky -c /home/ishikawa/.conkyrc | dzen2 -fn '-*-times-medium-r-*-*-*-*-*-*-*-*-*-*' -bg '#000000' -fg '#ffffff' -h 16 -w 498 -x 500 -ta r"

  • [solved] Xmonad periodically forgets keyboard shortcuts

    I'm running Xmonad + Xmobar. Sometimes, seemingly at random, Xmonad refuses to respond to certain shortcuts. I can't open a terminal, open dmenu, and possibly others. Others, such as switching layouts, changing workspaces, and restarting Xmonad work correctly.
    Does anyone have any experience with this? A Google search gave me a little info on a similar problem, but the solution doesn't apply.
    Last edited by urist (2009-12-11 04:05:54)

    From what I've seen, yours is the exact same problem. Putting a laptop running xmonad-darcs to sleep can potentially do something bad. In the future, I'll copy my config over to another laptop running xmonad from the repos to see if there's some difference between the two. I guess I also need to learn a bit of Haskell so I can modify the config I'm using to remove xmobar from it.

  • [SOLVED] xmonad + panel logging applets

    Until recently I used xmonad-log-applet, but after the last update, xmonad is unable to connect to dbus. I get the following error:
    xmonad-x86_64-linux: D-Bus Error (org.freedesktop.DBus.Error.NoReply): Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
    As this is quite a generic message, google wasn't of much help. and I know practically nothing about dbus, so I do not to know where to start looking for the problem. As an alternative I also tried this, which seems to take a simpler approach. But when I try to load it into my (xfce) panel (via XfApplet) I get this message:
    An internal error occurred and the applet could not be loaded.
    which is also quite informative... Starting a "real" gnome panel also doesn't help. Here I have the suspicion of some missing dependencies, although the program compiles just fine.
    Does anyone have some clues?
    Last edited by davvil (2011-04-28 09:19:15)

    I deserve a big facepalm! For the gnome-socket-applet I didn't export the GNOME_SOCKET_APPLET_PORT variable, so the program didn't start. I should have RTFM in more detail. But the socket-applet works at my computer at home, but not on the one at work
    I will mark this topic as solved, as I can use the dbus solution at work and the socket solution at home, but I am still intrigued why the difference arises. If I find the time, I will try to port the gnome-socket-applet to a native xfce panel applet and hopefully it will be more stable.
    BTW I uploaded a PKGBUILD for gnome-socket-applet

  • [SOLVED] Xmonad error when trying to compile the default xmonad.hs

    Hey,
    if I copy the configuration file in /usr/share/xmonad-0.11/man/xmonad.hs,
    I get the following error
    Error detected while loading xmonad configuration file: /home/me/.xmonad/xmonad.hs
    xmonad.hs:132:64: Not in scope: `help'
    Please check the file for errors.
    xmonad: xmessage: executeFile: does not exist (No such file or directory)
    The offending line is
    -- Run xmessage with a summary of the default keybindings (useful for beginners)
    , ((modMask .|. shiftMask, xK_slash ), spawn ("echo \"" ++ help ++ "\" | xmessage -file -"))
    I don't really need that particular keybinding but nevertheless I would like to know what's happening here.
    Last edited by Aton (2013-04-10 11:33:51)

    as for what's happening: help is just not defined.
    judging from the code you are trying to use, it is supposed to be a string. and indeed http://xmonad.org/xmonad-docs/xmonad/sr … Config.htm
    defines
    help :: String
    help = unlines ["The default modifier key is 'alt'. Default keybindings:",
    "-- launching and killing programs",
    "mod-Shift-Enter Launch xterminal",
    "mod-p Launch dmenu",
    "mod-Shift-p Launch gmrun",
    "mod-Shift-c Close/kill the focused window",
    "mod-Space Rotate through the available layout algorithms",
    "mod-Shift-Space Reset the layouts on the current workSpace to default",
    "mod-n Resize/refresh viewed windows to the correct size",
    "-- move focus up or down the window stack",
    "mod-Tab Move focus to the next window",
    "mod-Shift-Tab Move focus to the previous window",
    "mod-j Move focus to the next window",
    "mod-k Move focus to the previous window",
    "mod-m Move focus to the master window",
    "-- modifying the window order",
    "mod-Return Swap the focused window and the master window",
    "mod-Shift-j Swap the focused window with the next window",
    "mod-Shift-k Swap the focused window with the previous window",
    "-- resizing the master/slave ratio",
    "mod-h Shrink the master area",
    "mod-l Expand the master area",
    "-- floating layer support",
    "mod-t Push window back into tiling; unfloat and re-tile it",
    "-- increase or decrease number of windows in the master area",
    "mod-comma (mod-,) Increment the number of windows in the master area",
    "mod-period (mod-.) Deincrement the number of windows in the master area",
    "-- quit, or restart",
    "mod-Shift-q Quit xmonad",
    "mod-q Restart xmonad",
    "mod-[1..9] Switch to workSpace N",
    "-- Workspaces & screens",
    "mod-Shift-[1..9] Move client to workspace N",
    "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",
    "-- Mouse bindings: default actions bound to mouse events",
    "mod-button1 Set the window to floating mode and move by dragging",
    "mod-button2 Raise the window to the top of the stack",
    "mod-button3 Set the window to floating mode and resize by dragging"]

  • [probably SOLVED] xmonad + gnome again

    Hi folks!
    After running 'plain' xmonad-darcs for a time i'd like to run gnome together with xmonad, so installed gnome today (haven't used it for years). gnome is up and running, but i can't get to get it run with xmonad as it's wm~
    Of course i've tried to follow xmonad's wiki... I used other people's xmonad.hs, that basic one or that other one; additionally, xmonad-contrib-darcs v20081207-1 is installed. For completeness, I actually just use
    -- xmonad.hs
    import XMonad
    import XMonad.Config.Gnome
    main = xmonad gnomeConfig
    It seems, that somehow xmonad can't be imported: a new created ~/.gnomerc makes no change, same with a copied  "export WINDOW_MANAGER=xmonad"  in ~/.profile (which is sourced by .xinitrc) or even in ~/.xinitrc itself. I added xmonad to the list of starting programs in gnome's session manager as well, I disabled nautilus and changed the position of the panel... Trying to start gnome with this:
    export WINDOW_MANAGER=xmonad
    exec gnome-session --purge-delay=3000
    it says that --purge-delay is an invalid option (so i guess that is meant to work with an older version of gnome).
    Then it comes up to gnome-session. But in my gnome there is no possibility to "select Metacity and change style to Trash"!? (Within the "sessions" I only can add starting programs or tell which applications to remember.)
    Nevertheless, I can start an xterm and run "killall metacity; xmonad &"; then metacity disappears, windows are indeed tiling, but in the xterm there's the following output:
    $ unknown ClientMessageEvent 269
    unknown ClientMessageEvent 269
    unknown ClientMessageEvent 269
    unknown ClientMessageEvent 269
    unknown ClientMessageEvent 269
    and the system becomes almost unusable. After killing the xterm metactiy reappears.
    I wonder how Phrodo_00 solved his problem, seemed to be trivial...
    Any ideas?
    Last edited by nexus7 (2009-01-11 14:07:52)

    Ugh!
    Because starting x takes always 5-10 minutes I liked to speed it up. I thought it still could be gnome fighting against xmonad, since here xmonad is added as starting program while at the same time you have the "/usr/share/applications/xmonad.desktop" (see above). So I liked to  see what happens after deselecting xmoand as starting program in the sessions manager... But from now on gnome wouldn't  start at all anymore! Neither
    gconftool-2 -s -t string /desktop/gnome/session/required_components/windowmanager metacity
    nor
    rm -rf ~/.gnome* ~/.gconf*
    helped (I don't have a ~/.gnome2/session)! X just hangs after showing its cursor, and there are heavy cooling but lesser disk activities -- so how to reactivate plain gnome??
    But also suddenly another problem seem to arise (but for heavens sake, why~ there weren't any before...):
    In the first time I crashed X that error was shown in the console:
    (EE) intel(0): underrun on pipe B!
    -- But how comes?, I disabled these in /etc/xorg.conf:
    Section "ServerFlags"
    Option "AutoAddDevices" "False"
    Option "AutoEnableDevices" "False"
    EndSection
    Now there's another one:
    error setting MTRR (base = 0xe8000000, size = 0x08000000, type = 1) Invalid argument (22)
    Disgusting~
    Nevertheless running plain xmonad works... ((edit: after exchanging the xmonad.hs of course))
    Last edited by nexus7 (2009-01-11 12:03:52)

  • [SOLVED] xmonad stopped working properly in mid-session

    I recently installed xmonad, and after using it for a few hours, Mod-Spacebar stopped working so I rebooted Arch. After rebooting and using startx, xmonad starts but does not open windows with Mod-Shift-Return and the only command that works is Mod-Shift-Q to quit. My xmonad.hs file looks like this:
    import XMonad
    main = xmonad defaultConfig
    { terminal = "xterm"
    , modMask = mod4Mask
    , borderWidth = 3
    I have no idea what I changed to make this stop working. If anyone could figure out what's going on, it would be much appreciated. If more information/logs are needed, please let me know. Thanks for your answers in advance!
    EDIT: I reinstalled xmonad and rewrote xmonad.hs, and it appears to be working correctly.
    Last edited by TheAtomicGoose (2014-07-13 13:30:54)

    none                   /dev/pts      devpts    defaults            0      0
    EDIT: This should mount it:
    mount devpts /dev/pts -t devpts

  • [SOLVED] XMonad + Cairo-Compgr: error while loading libvala

    When I attempt to start cairo-compmgr in XMonad I receive this error:
    cairo-compmgr: error while loading shared libraries: libvala-0.10.so.0: cannot open shared object file: No such file or directory
    The latest version of vala is 0.11.6-1 so cairo is looking for an outdated version. I've reinstalled cairo and vala to no avail. From searching it looks like this is an error with the packagebuild or something but that's a little over my head.
    Last edited by Olson (2011-03-22 21:16:16)

    Seems so. You can see the status of mirrors in http://www.archlinux.org/mirrors/status/ to check one mirror up to date or use a tool like reflector for example.

Maybe you are looking for

  • Error message when trying to install Flip4Mac

    I get this every time I try to install Flip4Mac on Macbook Intel but I got the newest one that has Universal binary: What could be causing this and how could I fix it?

  • Activate "Open Item Management" for account, line items posted previously

    Hi SAP Gurus, I am having a problem when do a clearing for GL account due to "open item management" check box in Txn FS00 is not activated and only "Line Item Display" is activated. For your info,  there are line items already posted and now we want

  • Imovie11 wont take quicktime

    Imovie will not load Quicktime video files   I have been able to in the past with Imovie 9     Tanks

  • Why is flash cc broken

    Hi, I really really really need you guys to fix flash. It is my major tool at work. We have upgraded to cloud and I can no longer do my job. For example. I can no longer free hand draw!!!!! pencil and brush are useless as a creative tool. I cant even

  • Adjusting margins in Reader

    Hello all, and thank you for taking the time to read this. I'm trying to print a PDF of a document which original I don't have.  The document already has a significant margin, and Reader is adding 25 Milimeters. If I were to print it straight, I woul