diff options
author | Lukas Mai <l.mai@web.de> | 2007-12-20 21:39:53 +0100 |
---|---|---|
committer | Lukas Mai <l.mai@web.de> | 2007-12-20 21:39:53 +0100 |
commit | 164834491c16d6d7eb17f21b3ab8b8a2f27d51bf (patch) | |
tree | b92603743e3c077cadf8c4411554d2fb70158c22 /XMonad/Actions | |
parent | 8014a7f3d0af29d91e9403bba7267949e2514c76 (diff) | |
download | XMonadContrib-164834491c16d6d7eb17f21b3ab8b8a2f27d51bf.tar.gz XMonadContrib-164834491c16d6d7eb17f21b3ab8b8a2f27d51bf.tar.xz XMonadContrib-164834491c16d6d7eb17f21b3ab8b8a2f27d51bf.zip |
add XMonad.Actions.NoBorders
darcs-hash:20071220203953-462cf-2d453dbf8078836204f8baa420292adc7296fbc3.gz
Diffstat (limited to 'XMonad/Actions')
-rw-r--r-- | XMonad/Actions/NoBorders.hs | 33 |
1 files changed, 33 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 |