summaryrefslogtreecommitdiff
path: root/desktop/xmonad
diff options
context:
space:
mode:
authorDaniel Silverstone (parasomnia chroot) <dsilvers@digital-scurf.org>2013-03-31 11:52:27 +0100
committerDaniel Silverstone (parasomnia chroot) <dsilvers@digital-scurf.org>2013-03-31 11:52:27 +0100
commit6316ce27dfec50ca9f20009eb6f684102ed1851c (patch)
tree7f2ebc0bb5789a2ff28933b7069e6f9a63aba215 /desktop/xmonad
parent9ebbf77fb15cc796a83a0c2c2cc42d3dea056dda (diff)
downloadresources-6316ce27dfec50ca9f20009eb6f684102ed1851c.tar.bz2
Update to latest taffybar support, add mail.
Latest taffybar expects the DBus.Client not DBus.Client.Simple stuff. Also, add a keypress C-A-M-m to launch mail (or focus if present) and all associated guffery.
Diffstat (limited to 'desktop/xmonad')
-rw-r--r--desktop/xmonad/xmonad.hs34
1 files changed, 33 insertions, 1 deletions
diff --git a/desktop/xmonad/xmonad.hs b/desktop/xmonad/xmonad.hs
index 8384833..ae193d8 100644
--- a/desktop/xmonad/xmonad.hs
+++ b/desktop/xmonad/xmonad.hs
@@ -4,10 +4,11 @@ import XMonad.Actions.DynamicWorkspaces
import XMonad.Prompt
import XMonad.Prompt.Shell
import XMonad.Prompt.XMonad
+import XMonad.Util.Run
import qualified XMonad.Util.EZConfig as EZ
import qualified XMonad.StackSet as W
import XMonad.Actions.CycleWS
-import DBus.Client.Simple
+import DBus.Client
import qualified XMonad.Actions.DynamicWorkspaceOrder as DO
import System.Taffybar.XMonadLog ( dbusLogWithPP, taffybarDefaultPP )
import XMonad.Hooks.DynamicLog
@@ -15,6 +16,35 @@ import XMonad.Hooks.EwmhDesktops
import XMonad.Layout.NoBorders
import XMonad.Layout.MultiToggle
import XMonad.Layout.MultiToggle.Instances
+import XMonad.Actions.WindowGo
+import Control.Monad (liftM2)
+
+launchInSpeshulTerminal :: String -> String -> X ()
+launchInSpeshulTerminal roleTitle cmd = do
+ safeSpawn "gnome-terminal" [ "--role"
+ , roleTitle
+ , "--title"
+ , roleTitle
+ , "-e"
+ , cmd ]
+
+launchSpeshulUnlessPresent :: String -> String -> X ()
+launchSpeshulUnlessPresent roleTitle cmd = do
+ raiseMaybe (launchInSpeshulTerminal roleTitle cmd) (title =? roleTitle)
+
+launchOrRaiseEmail :: X ()
+launchOrRaiseEmail = do
+ launchSpeshulUnlessPresent "OfflineIMAP" "offlineimap"
+ launchSpeshulUnlessPresent "Mutt" "mutt"
+
+
+
+myManageHook =
+ composeAll [ title =? "OfflineIMAP" --> doShift "mail"
+ , title =? "Mutt" --> viewShift "mail"
+ ]
+ where
+ viewShift = doF . liftM2 (.) W.greedyView W.shift
main :: IO ()
main = do
@@ -23,6 +53,7 @@ main = do
xmonad $ gnomeConfig
{ modMask = mod4Mask
, logHook = (logHook gnomeConfig) >> dbusLogWithPP client pp
+ , manageHook = myManageHook <+> manageHook gnomeConfig
, workspaces = defaultWorkSpaces
, handleEventHook = fullscreenEventHook
, layoutHook = id
@@ -32,6 +63,7 @@ main = do
} `EZ.additionalKeysP`
[ -- General keys
("M-x", spawn "gnome-terminal")
+ , ("M-M1-C-m", launchOrRaiseEmail)
, ("M1-<F2>", shellPrompt defaultXPConfig)
-- Screens, Workspaces and Windows
, ("M1-C-<Left>", DO.moveTo Prev AnyWS)