diff options
-rw-r--r-- | XMonad/Actions/NoBorders.hs | 33 | ||||
-rw-r--r-- | xmonad-contrib.cabal | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/XMonad/Actions/NoBorders.hs b/XMonad/Actions/NoBorders.hs new file mode 100644 index 0000000..a30d8b3 --- /dev/null +++ b/XMonad/Actions/NoBorders.hs @@ -0,0 +1,33 @@ +----------------------------------------------------------------------------- +-- | +-- Module : XMonad.Actions.NoBorders +-- Copyright : (c) Lukas Mai +-- License : BSD3-style (see LICENSE) +-- +-- Maintainer : Lukas Mai <l.mai@web.de> +-- Stability : unstable +-- Portability : unportable +-- +-- This module provides helper functions for dealing with window borders. +-- +----------------------------------------------------------------------------- + +module XMonad.Actions.NoBorders ( + toggleBorder +) where + +import XMonad + +-- | Toggle the border of the currently focused window. To use it, add a +-- keybinding like so: +-- +-- > , ((modMask x, xK_g ), withFocused toggleBorder) +-- +toggleBorder :: Window -> X () +toggleBorder w = do + bw <- asks (borderWidth . config) + withDisplay $ \d -> io $ do + cw <- wa_border_width `fmap` getWindowAttributes d w + if cw == 0 + then setWindowBorderWidth d w bw + else setWindowBorderWidth d w 0 diff --git a/xmonad-contrib.cabal b/xmonad-contrib.cabal index 79b1a6a..f878662 100644 --- a/xmonad-contrib.cabal +++ b/xmonad-contrib.cabal @@ -62,6 +62,7 @@ library XMonad.Actions.FloatKeys XMonad.Actions.FocusNth XMonad.Actions.MouseGestures + XMonad.Actions.NoBorders XMonad.Actions.RotSlaves XMonad.Actions.RotView XMonad.Actions.SimpleDate |