xmonad: fixed borring windows/workspace switching

This commit is contained in:
Ingolf Wagner 2019-11-07 16:24:47 +01:00
parent 99fd873cb8
commit 771705fe6b
Signed by: palo
GPG key ID: 76BF5F1928B9618B

View file

@ -160,13 +160,17 @@ myKeys XConfig {modMask = modm} =
--
-- mod-[1..9], Switch to workspace N
[ ( (m .|. modm, k)
, removeEmptyWorkspaceAfterExcept nonRemovableWorkspaces $ windows $ f i)
, do removeEmptyWorkspaceAfterExcept nonRemovableWorkspaces $ windows $ f i
updateBoring
)
| (i, k) <- zip myWorkspaces [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0)]
] ++
-- mod-<shift>-[1..9] move window to workspace N
-- mod-<control>-[1..9] copy window to workspace N
[ ((m .|. modm, k), windows $ f i)
[ ((m .|. modm, k),
do windows $ f i
updateBoring)
| (i, k) <- zip myWorkspaces [xK_1 .. xK_9]
, (f, m) <- [(W.shift, shiftMask), (copy, controlMask)]
]
@ -220,8 +224,10 @@ myAdditionaKeys
=
(multiKeys
[ ( "`"
, removeEmptyWorkspaceAfterExcept nonRemovableWorkspaces $
withWorkspace autoXPConfig (windows . W.greedyView))
, do
removeEmptyWorkspaceAfterExcept nonRemovableWorkspaces
( withWorkspace autoXPConfig (windows . W.greedyView ))
updateBoring)
-- move focused window to workspace
, ("S-<Space>", withWorkspace myXPConfig (windows . W.shift))
-- copy focused window to workspace
@ -239,7 +245,9 @@ myAdditionaKeys
, ( "r"
, do renameWorkspace myXPConfig
sequence_ [addHiddenWorkspace ws | ws <- myWorkspaces])
, ("<Esc>", toggleWS' ["NSP"])
, ("<Esc>", do toggleWS' ["NSP"]
updateBoring
)
]) ++
-- ------------------------------------------------------------
--
@ -251,7 +259,8 @@ myAdditionaKeys
[ ("<Return>", spawn $ XMonad.terminal defaults)
, ("q", kill1)
-- open scratchpad
, ("-", scratchpadSpawnAction defaults)
, ("-", do scratchpadSpawnAction defaults
updateBoring)
]) ++
[ ( "<Print>"
-- create screenshot
@ -483,6 +492,12 @@ main = do
myTerm :: FilePath
myTerm = nixStartTerminal
-- make sure we never select a boring window
-- when we select another workspace.
updateBoring = do focusUp
focusDown
-- A structure containing your configuration settings, overriding
-- fields in the default config. Any you don't override, will
-- use the defaults defined in xmonad/XMonad/Config.hs
@ -512,12 +527,20 @@ defaults =
-- key bindings
, keys = myKeys
, mouseBindings = mouse
-- hooks, layouts
, layoutHook = focusTracking $ historyLayout myLayout
-- todo: historyLayout does not work with boring windows yet
, layoutHook = focusTracking $ myLayout
-- , layoutHook = focusTracking $ historyLayout myLayout
-- todo : runAllPending does not work with boring windows yet
, logHook = myLogHook
-- , logHook = myLogHook <> runAllPending
, startupHook = startUp
, manageHook = myManageHook
, handleEventHook = myEventHook
, logHook = myLogHook <> runAllPending
, startupHook = startUp
} `additionalKeysP`
myAdditionaKeys