diff --git a/src/XMonad/Custom/Modifiers.hs b/src/XMonad/Custom/Modifiers.hs index d9b83c1..0caadee 100644 --- a/src/XMonad/Custom/Modifiers.hs +++ b/src/XMonad/Custom/Modifiers.hs @@ -13,6 +13,6 @@ myTertiaryModMask = controlMask -- control -- | For XMonad.Util.EZConfig, these can be used myMainModifier, mySecondaryModifier, myTertiaryModifier :: String -myMainModifier = "M" +myMainModifier = "M4" mySecondaryModifier = "M1" myTertiaryModifier = "C" diff --git a/src/XMonad/Custom/NumberWorkspaces.hs b/src/XMonad/Custom/NumberWorkspaces.hs new file mode 100644 index 0000000..55cd540 --- /dev/null +++ b/src/XMonad/Custom/NumberWorkspaces.hs @@ -0,0 +1,20 @@ +module XMonad.Custom.NumberWorkspaces (myNumberWorkspaces, myNumberWorkspacesKeyBindings) where + +import XMonad +import XMonad.Custom.Workspaces +import XMonad.Custom.Modifiers + + +myNumberWorkspacesKeyBindings :: [(String, X())] +myNumberWorkspacesKeyBindings = concat [ + makeWorkspacesCombined myMainModifier $ zip digits first10 + , makeWorkspacesCombined mySecondaryModifier $ zip digits second10 + ] + +myNumberWorkspaces :: [String] +myNumberWorkspaces = first10 ++ second10 + +digits, first10, second10 :: [String] +digits = map show $ [1 .. 9 :: Int] ++ [0 :: Int] +first10 = map show $ [1 .. 10 :: Int] +second10 = map show $ [11 .. 20 :: Int] diff --git a/src/XMonad/Custom/Workspaces.hs b/src/XMonad/Custom/Workspaces.hs index b1dad80..d111d7b 100644 --- a/src/XMonad/Custom/Workspaces.hs +++ b/src/XMonad/Custom/Workspaces.hs @@ -4,6 +4,9 @@ import XMonad import XMonad.Custom.BindingUtils +makeWorkspacesCombined :: String -> [(String, String)] -> [(String, X())] +makeWorkspacesCombined m ws = (\(a,b) -> a ++ b) $ makeWorkspaces m ws + makeWorkspaces :: String -> [(String, String)] -> ([(String, X ())], [(String, X ())]) makeWorkspaces m ws= (makeFocusBindings m ws, makeShiftBindings m ws) diff --git a/xmonad-custom.cabal b/xmonad-custom.cabal index 023cda5..a2a39b4 100644 --- a/xmonad-custom.cabal +++ b/xmonad-custom.cabal @@ -17,6 +17,7 @@ library XMonad.Custom.Layout XMonad.Custom.Workspaces XMonad.Custom.Modifiers + XMonad.Custom.NumberWorkspaces hs-source-dirs: src ghc-options: -funbox-strict-fields -Wall -Wno-unused-do-bind build-depends: base