add 20 number workspaces

This commit is contained in:
Maximilian Keßler 2022-07-17 10:25:37 +02:00
parent 00df00f750
commit ca6600710f
4 changed files with 25 additions and 1 deletions

View file

@ -13,6 +13,6 @@ myTertiaryModMask = controlMask -- control
-- | For XMonad.Util.EZConfig, these can be used -- | For XMonad.Util.EZConfig, these can be used
myMainModifier, mySecondaryModifier, myTertiaryModifier :: String myMainModifier, mySecondaryModifier, myTertiaryModifier :: String
myMainModifier = "M" myMainModifier = "M4"
mySecondaryModifier = "M1" mySecondaryModifier = "M1"
myTertiaryModifier = "C" myTertiaryModifier = "C"

View file

@ -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]

View file

@ -4,6 +4,9 @@ import XMonad
import XMonad.Custom.BindingUtils 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 :: String -> [(String, String)] -> ([(String, X ())], [(String, X ())])
makeWorkspaces m ws= (makeFocusBindings m ws, makeShiftBindings m ws) makeWorkspaces m ws= (makeFocusBindings m ws, makeShiftBindings m ws)

View file

@ -17,6 +17,7 @@ library
XMonad.Custom.Layout XMonad.Custom.Layout
XMonad.Custom.Workspaces XMonad.Custom.Workspaces
XMonad.Custom.Modifiers XMonad.Custom.Modifiers
XMonad.Custom.NumberWorkspaces
hs-source-dirs: src hs-source-dirs: src
ghc-options: -funbox-strict-fields -Wall -Wno-unused-do-bind ghc-options: -funbox-strict-fields -Wall -Wno-unused-do-bind
build-depends: base build-depends: base