I am trying to give focus to a window whenever the cursor moves on it.
Use case:
- window A focused by the cursor
- user moves focus with the keyboard
- user moves the mouse and expects the window below the cursor to activate
Instead of 3, I am required to move the cursor to another window, then back.
This exists, and seems to do exactly what I want. I can't make it work.
Here is what I have, see rows 121 and 122, or see the diff in case it's easier (there are a couple changes with indentation, I leave it here just to be sure not to remove anything relevant):
@@ -1,5 +1,6 @@
import XMonad hiding ((|||))
import XMonad.Actions.RotSlaves
+import XMonad.Actions.UpdateFocus
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
@@ -111,12 +112,14 @@ myKeys =
, (f, m) <- [(W.view, 0), (W.shift, shiftMask)]]
main = do
- xmproc <- spawnPipe "/usr/bin/xmobar ~/.xmonad/.xmobarrc -x 0"
- --xmproc <- spawnPipe "~/.cabal/bin/xmobar ~/.xmonad/.xmobarrc -x 1"
- xmonad $ withUrgencyHook NoUrgencyHook
- $ defaultConfig {
+ xmproc <- spawnPipe "/usr/bin/xmobar ~/.xmonad/.xmobarrc -x 0"
+ xmonad
+ $ withUrgencyHook NoUrgencyHook
+ $ defaultConfig {
workspaces = myWorkspaces
, terminal = "gnome-terminal"
+ , startupHook = adjustEventInput
+ , handleEventHook = focusOnMouseMove
, manageHook = myManageHook <+> manageHook defaultConfig
, layoutHook = avoidStruts $ smartBorders $ myLayout
, logHook = dynamicLogWithPP xmobarPP
xmonad
version 0.12. I've tried not only mod+q
, but also logging out and in.