diff options
author | tv <tv@krebsco.de> | 2016-06-06 17:17:07 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2016-06-06 17:17:07 +0200 |
commit | dda2887e2cf618a7c7744bee2eed806e3a38fe36 (patch) | |
tree | 19ad3210a2b8485ac22d26f75b2e2493d3f61596 /lass/5pkgs/xmonad-lass/Util/PerWorkspaceConfig.hs | |
parent | c1c645b545b960eb639fc6d41dfa35ee187ae164 (diff) | |
parent | 7e344c0627a266685ef1ad79f5193b4e7ba27408 (diff) |
Merge remote-tracking branch 'cloudkrebs/master'
Diffstat (limited to 'lass/5pkgs/xmonad-lass/Util/PerWorkspaceConfig.hs')
-rw-r--r-- | lass/5pkgs/xmonad-lass/Util/PerWorkspaceConfig.hs | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/lass/5pkgs/xmonad-lass/Util/PerWorkspaceConfig.hs b/lass/5pkgs/xmonad-lass/Util/PerWorkspaceConfig.hs deleted file mode 100644 index bba7c8c60..000000000 --- a/lass/5pkgs/xmonad-lass/Util/PerWorkspaceConfig.hs +++ /dev/null @@ -1,52 +0,0 @@ -module Util.PerWorkspaceConfig - ( WorkspaceConfig (..) - , WorkspaceConfigs - , switchToWorkspace - , defaultWorkspaceConfig - , perWorkspaceAction - , perWorkspaceTermAction --- , myLayoutHack - ) -where - -import XMonad -import XMonad.Core (LayoutClass) -import Control.Monad (when) - -import qualified Data.Map as M -import qualified XMonad.StackSet as W - -data WorkspaceConfig l = - WorkspaceConfig - { switchAction :: X () - , startAction :: X () - , keyAction :: X () - , termAction :: X () - } - -type WorkspaceConfigs l = M.Map WorkspaceId (WorkspaceConfig l) - -defaultWorkspaceConfig = WorkspaceConfig - { switchAction = return () - , startAction = return () - , keyAction = return () - , termAction = spawn "urxvtc" - } - -whenLookup wsId cfg a = - when (M.member wsId cfg) (a $ cfg M.! wsId) - -switchToWorkspace :: WorkspaceConfigs l -> WorkspaceId -> X () -switchToWorkspace cfg wsId = do - windows $ W.greedyView wsId - wins <- gets (W.integrate' . W.stack . W.workspace . W.current . windowset) - when (null wins) $ whenLookup wsId cfg startAction - whenLookup wsId cfg switchAction - -perWorkspaceAction :: WorkspaceConfigs l -> X () -perWorkspaceAction cfg = withWindowSet $ \s -> whenLookup (W.currentTag s) cfg keyAction - -perWorkspaceTermAction :: WorkspaceConfigs l -> X () -perWorkspaceTermAction cfg = withWindowSet $ \s -> case M.lookup (W.currentTag s) cfg of - Just x -> termAction x - _ -> termAction defaultWorkspaceConfig |