mirror of
https://github.com/srid/nixos-config.git
synced 2026-05-11 00:55:58 +08:00
xmonad: pointer follows focus (trackpoint love)
This commit is contained in:
parent
646d51332a
commit
89a5c66949
1 changed files with 11 additions and 4 deletions
|
|
@ -1,8 +1,8 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE TypeApplications #-}
|
||||
|
||||
import qualified Data.Map.Strict as M
|
||||
import XMonad
|
||||
import XMonad.Actions.UpdatePointer (updatePointer)
|
||||
import XMonad.Hooks.EwmhDesktops (ewmh)
|
||||
import XMonad.Hooks.ManageDocks (ToggleStruts (..), avoidStruts, docks)
|
||||
import XMonad.Layout.NoBorders (withBorder)
|
||||
|
|
@ -22,14 +22,20 @@ main = do
|
|||
{ modMask = mod4Mask, -- Use Super instead of Alt
|
||||
terminal = "alacritty", -- "myst",
|
||||
layoutHook =
|
||||
borderSpacing $
|
||||
borderSpacingBetweenWindows $
|
||||
avoidStruts $
|
||||
ThreeColMid 1 (3 / 100) (1 / 2) ||| layoutHook def,
|
||||
logHook =
|
||||
pointerFollowsFocus,
|
||||
keys = myKeys,
|
||||
-- https://htmlcolorcodes.com/
|
||||
focusedBorderColor = "#50CBE8"
|
||||
}
|
||||
-- Add border spacing between windows
|
||||
|
||||
pointerFollowsFocus =
|
||||
let centerOfWindow = ((0.5, 0.5), (0, 0))
|
||||
in uncurry updatePointer centerOfWindow
|
||||
|
||||
myKeys baseConfig@XConfig {modMask = modKey} =
|
||||
keys def baseConfig
|
||||
<> M.fromList
|
||||
|
|
@ -38,7 +44,8 @@ main = do
|
|||
((modKey, xK_b), sendMessage ToggleStruts)
|
||||
-- ...
|
||||
]
|
||||
borderSpacing =
|
||||
|
||||
borderSpacingBetweenWindows =
|
||||
withBorder 5
|
||||
. spacingRaw
|
||||
-- Apply borders only when there are 2 or more windows
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue