From 751bec947c2392ccd1f0539c9618e143c0303496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sun, 17 Jul 2022 09:59:10 +0200 Subject: [PATCH] add central place for modifiers --- src/XMonad/Custom/Modifiers.hs | 18 ++++++++++++++++++ src/XMonad/Custom/ProgramWorkSpaces.hs | 9 +++++---- xmonad-custom.cabal | 2 ++ 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 src/XMonad/Custom/Modifiers.hs diff --git a/src/XMonad/Custom/Modifiers.hs b/src/XMonad/Custom/Modifiers.hs new file mode 100644 index 0000000..d9b83c1 --- /dev/null +++ b/src/XMonad/Custom/Modifiers.hs @@ -0,0 +1,18 @@ +module XMonad.Custom.Modifiers where + +import Graphics.X11.Types + + + +-- | Used when giving KeyMasks directly +myMainModMask, mySecondaryModMask, myTertiaryModMask:: KeyMask + +myMainModMask = mod4Mask -- Super_L +mySecondaryModMask = mod1Mask -- Alt_L +myTertiaryModMask = controlMask -- control + +-- | For XMonad.Util.EZConfig, these can be used +myMainModifier, mySecondaryModifier, myTertiaryModifier :: String +myMainModifier = "M" +mySecondaryModifier = "M1" +myTertiaryModifier = "C" diff --git a/src/XMonad/Custom/ProgramWorkSpaces.hs b/src/XMonad/Custom/ProgramWorkSpaces.hs index 82449ce..44d33cf 100644 --- a/src/XMonad/Custom/ProgramWorkSpaces.hs +++ b/src/XMonad/Custom/ProgramWorkSpaces.hs @@ -5,11 +5,12 @@ import XMonad.Actions.WindowGo import XMonad.Custom.BindingUtils import XMonad.Custom.Workspaces +import XMonad.Custom.Modifiers --- | -myProgramWorkSpaceSuperKey :: String -myProgramWorkSpaceSuperKey = "M1" +-- | use secondary modifier to access program workspaces +myProgramWorkSpaceModifier :: String +myProgramWorkSpaceModifier = mySecondaryModifier -- | WorkSpaces (key, label, executable, className/ general ) type ProgramWorkSpace = (String, String, String, Query Bool) @@ -61,7 +62,7 @@ myProgramWorkSpaces = map second4 myProgramWorkSpacesConfig rawFocusBindings :: [(String, X())] myProgramWorkSpacesShiftBindings :: [(String, X())] (rawFocusBindings, myProgramWorkSpacesShiftBindings) = - makeWorkspaces myProgramWorkSpaceSuperKey (map quadrupleToPairFront myProgramWorkSpacesConfig) + makeWorkspaces myProgramWorkSpaceModifier (map quadrupleToPairFront myProgramWorkSpacesConfig) myProgramWorkSpacesFocusBindingsNoLaunch :: [(String, X ())] myProgramWorkSpacesFocusBindingsNoLaunch = addControlToBinding rawFocusBindings diff --git a/xmonad-custom.cabal b/xmonad-custom.cabal index 918fea8..54a61a4 100644 --- a/xmonad-custom.cabal +++ b/xmonad-custom.cabal @@ -16,10 +16,12 @@ library XMonad.Custom.UniversitySetup XMonad.Custom.Layout XMonad.Custom.Workspaces + XMonad.Custom.Modifiers hs-source-dirs: src ghc-options: -funbox-strict-fields -Wall -Wno-unused-do-bind build-depends: base , xmonad , xmonad-contrib , ghc + , X11 default-language: Haskell2010