summaryrefslogtreecommitdiffstats
path: root/tv/2configs/xserver/xmonad-tv/Util/Debunk.hs
blob: b4772e5826b13a3533c2fd69c865f7cbb02ef76c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module Util.Debunk
    ( printToErrors
    ) where

import XMonad
import System.FilePath ( (</>) )
import Control.Exception ( bracket )
import System.IO ( hPrint, stderr, openFile, hClose, IOMode( AppendMode ) )


printToErrors x = do
    dir <- getXMonadDir
    let base = dir </> "xmonad"
        err  = base ++ ".errors"
    bracket (openFile err AppendMode) hClose $ \h -> hPrint h x