module Shortcuts ( Config , new ) where import Data.Map (Map) import System.Posix.Process (executeFile) import XMonad (Layout, KeyMask, KeySym, X, XConfig, xfork) import XMonad.Util.EZConfig (mkKeymap) import qualified Data.Map.Strict as Map type Config = Map String String new :: Config -> XConfig Layout -> Map (KeyMask, KeySym) (X ()) new config xconfig = mkKeymap xconfig $ map (\(key, path) -> (key, forkFile path [] Nothing)) $ Map.toList config forkFile :: FilePath -> [String] -> Maybe [(String, String)] -> X () forkFile path args env = xfork (executeFile path True args env) >> return ()