diff options
author | Azat Bahawi <azahi@teknik.io> | 2021-11-23 03:19:06 +0300 |
---|---|---|
committer | Azat Bahawi <azahi@teknik.io> | 2021-11-23 03:19:06 +0300 |
commit | 729e030dd25da2e36fa5a1312b8ecb3415dc1675 (patch) | |
tree | 53166b6c3bd96f860d0a7242353ef9cc7bb1790f /src/XMonad/Actions/PerConditionKeys.hs | |
parent | Remove tests (diff) |
Huge update
Diffstat (limited to 'src/XMonad/Actions/PerConditionKeys.hs')
-rw-r--r-- | src/XMonad/Actions/PerConditionKeys.hs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/XMonad/Actions/PerConditionKeys.hs b/src/XMonad/Actions/PerConditionKeys.hs deleted file mode 100644 index 09372cd..0000000 --- a/src/XMonad/Actions/PerConditionKeys.hs +++ /dev/null @@ -1,34 +0,0 @@ --- | --- Module : XMonad.Actions.PerConditionKeys --- Copyright : (c) 2018-2020 Azat Bahawi <azahi@teknik.io> --- License : BSD3-style (see LICENSE) --- Maintainer : Azat Bahawi <azahi@teknik.io> --- Stability : unstable --- Portability : unportable --- - -module XMonad.Actions.PerConditionKeys - ( XCond(..) - , chooseAction - , bindOn - ) where - -import Data.List -import XMonad -import qualified XMonad.StackSet as S - -data XCond = WS | LD - -chooseAction :: XCond -> (String -> X ()) -> X () -chooseAction WS f = withWindowSet (f . S.currentTag) -chooseAction LD f = - withWindowSet (f . description . S.layout . S.workspace . S.current) - -bindOn :: XCond -> [(String, X ())] -> X () -bindOn xc bindings = chooseAction xc chooser - where - chooser x = case find ((x ==) . fst) bindings of - Just (_, action) -> action - Nothing -> case find (("" ==) . fst) bindings of - Just (_, action) -> action - Nothing -> return () |