diff --git a/system/desktop/home-manager/xmonad/Main.hs b/system/desktop/home-manager/xmonad/Main.hs index 387a0da..6a4a37d 100644 --- a/system/desktop/home-manager/xmonad/Main.hs +++ b/system/desktop/home-manager/xmonad/Main.hs @@ -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--[1..9] move window to workspace N -- mod--[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-", withWorkspace myXPConfig (windows . W.shift)) -- copy focused window to workspace @@ -239,7 +245,9 @@ myAdditionaKeys , ( "r" , do renameWorkspace myXPConfig sequence_ [addHiddenWorkspace ws | ws <- myWorkspaces]) - , ("", toggleWS' ["NSP"]) + , ("", do toggleWS' ["NSP"] + updateBoring + ) ]) ++ -- ------------------------------------------------------------ -- @@ -251,7 +259,8 @@ myAdditionaKeys [ ("", spawn $ XMonad.terminal defaults) , ("q", kill1) -- open scratchpad - , ("-", scratchpadSpawnAction defaults) + , ("-", do scratchpadSpawnAction defaults + updateBoring) ]) ++ [ ( "" -- 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