aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Hooks
diff options
context:
space:
mode:
authorBrent Yorgey <byorgey@gmail.com>2008-02-01 13:04:30 +0100
committerBrent Yorgey <byorgey@gmail.com>2008-02-01 13:04:30 +0100
commit67af43c814819f0c836f796b6f1c61cc446143df (patch)
tree83d468e6c97d165da66fa77c1d062f2673845b98 /XMonad/Hooks
parent1fb7bc5eeeb14107abc57e50b33096f4758f5909 (diff)
downloadXMonadContrib-67af43c814819f0c836f796b6f1c61cc446143df.tar.gz
XMonadContrib-67af43c814819f0c836f796b6f1c61cc446143df.tar.xz
XMonadContrib-67af43c814819f0c836f796b6f1c61cc446143df.zip
WorkspaceCompare: some refactoring.
* Export WorkspaceCompare and WorkspaceSort types. * Extract commonality in sort methods into mkWsSort, which creates a workspace sort from a workspace comparison function. * Rename getSortByTag to getSortByIndex, since it did not actually sort by tag at all; it sorts by index of workspace tags in the user's config. * Create a new getSortByTag function which actually does sort lexicographically by tag. * Enhance documentation. darcs-hash:20080201120430-bd4d7-71310db2b8d4248ddfb77e3fa25dd0f3b98ea00b.gz
Diffstat (limited to 'XMonad/Hooks')
-rw-r--r--XMonad/Hooks/DynamicLog.hs6
-rw-r--r--XMonad/Hooks/EwmhDesktops.hs12
2 files changed, 9 insertions, 9 deletions
diff --git a/XMonad/Hooks/DynamicLog.hs b/XMonad/Hooks/DynamicLog.hs
index ecc4891..def78e7 100644
--- a/XMonad/Hooks/DynamicLog.hs
+++ b/XMonad/Hooks/DynamicLog.hs
@@ -268,7 +268,7 @@ defaultPP = PP { ppCurrent = wrap "[" "]"
, ppLayout = id
, ppOrder = id
, ppOutput = putStrLn
- , ppSort = getSortByTag
+ , ppSort = getSortByIndex
}
-- | Settings to emulate dwm's statusbar, dzen only.
@@ -305,10 +305,10 @@ byorgeyPP = defaultPP { ppHiddenNoWindows = showNamedWorkspaces
, ppUrgent = dzenColor "red" "yellow"
, ppSep = " | "
, ppWsSep = ""
- , ppTitle = shorten 65
+ , ppTitle = shorten 70
, ppOrder = reverse
}
- where showNamedWorkspaces wsId = if (':' `elem` wsId)
+ where showNamedWorkspaces wsId = if any (`elem` wsId) ['a'..'z']
then pad wsId
else ""
diff --git a/XMonad/Hooks/EwmhDesktops.hs b/XMonad/Hooks/EwmhDesktops.hs
index 231525d..5a3d030 100644
--- a/XMonad/Hooks/EwmhDesktops.hs
+++ b/XMonad/Hooks/EwmhDesktops.hs
@@ -38,17 +38,17 @@ import XMonad.Util.WorkspaceCompare
-- > return ()
-- >
-- > main = xmonad defaultConfig { logHook = myLogHook }
---
+--
-- For more detailed instructions on editing the layoutHook see:
--
-- "XMonad.Doc.Extending#The_log_hook_and_external_status_bars"
--- |
+-- |
-- Notifies pagers and window lists, such as those in the gnome-panel
-- of the current state of workspaces and windows.
ewmhDesktopsLogHook :: X ()
ewmhDesktopsLogHook = withWindowSet $ \s -> do
- sort' <- getSortByTag
+ sort' <- getSortByIndex
let ws = sort' $ W.workspaces s
let wins = W.allWindows s
@@ -62,7 +62,7 @@ ewmhDesktopsLogHook = withWindowSet $ \s -> do
-- Current desktop
let curr = fromJust $ elemIndex (W.tag (W.workspace (W.current s))) $ map W.tag ws
-
+
setCurrentDesktop curr
setClientList wins
@@ -70,11 +70,11 @@ ewmhDesktopsLogHook = withWindowSet $ \s -> do
-- Per window Desktop
-- To make gnome-panel accept our xinerama stuff, we display
-- all visible windows on the current desktop.
- forM_ (W.current s : W.visible s) $ \x ->
+ forM_ (W.current s : W.visible s) $ \x ->
forM_ (W.integrate' (W.stack (W.workspace x))) $ \win -> do
setWindowDesktop win curr
- forM_ (W.hidden s) $ \w ->
+ forM_ (W.hidden s) $ \w ->
let wn = fromJust $ elemIndex (W.tag w) (map W.tag ws) in
forM_ (W.integrate' (W.stack w)) $ \win -> do
setWindowDesktop win wn