Created
August 8, 2021 13:10
-
-
Save henninb/a4750dc859ec7ed96fc2d48bd911294e to your computer and use it in GitHub Desktop.
subset of my xmonad config - trying to perform a greedyView with shift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--viewShift :: WorkspaceId -> Query (Endo (W.StackSet WorkspaceId l Window ScreenId sd)) | |
--viewShift = doF . liftM2 (.) W.greedyView W.shift | |
keybinds :: XConfig Layout -> [((KeyMask, KeySym), NamedActions.NamedAction)] | |
keybinds conf = let | |
subKeys str ks = NamedActions.subtitle str : mkNamedKeymap conf ks | |
wsKeys = map show ([1..9] ++ [0] :: [Int]) | |
zipM m nm ks as f = zipWith (\k d -> (m ++ k, NamedActions.addName nm $ f d)) ks as | |
zipM' m nm ks as f b = zipWith(\k d -> (m ++ k, NamedActions.addName nm $ f d b)) ks as | |
in | |
subKeys "Workspaces" | |
([] | |
++ zipM "M-" "View workspace" wsKeys [0..] (withNthWorkspace W.greedyView) | |
++ zipM "M-S-" "Move window to workspace" wsKeys [0..] (withNthWorkspace W.shift) | |
++ zipM "M-S-C-" "Copy window to workkspace" wsKeys [0..] (withNthWorkspace copy) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solutions 1:
++ zipM "M-S-" "Move window to workspace" wsKeys [0..] (withNthWorkspace (\i -> W.greedyView i . W.shift i))
Solution 2:
++ zipM "M-S-" "Move window to workspace" wsKeys [0..] (withNthWorkspace (liftM2 (.) W.greedyView W.shift))