add central place for modifiers

This commit is contained in:
Maximilian Keßler 2022-07-17 09:59:10 +02:00
parent 0516f51ba6
commit 751bec947c
3 changed files with 25 additions and 4 deletions

View file

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

View file

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

View file

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