summaryrefslogtreecommitdiffstats
path: root/tv/2configs/xserver/xmonad-tv/Util/Debunk.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tv/2configs/xserver/xmonad-tv/Util/Debunk.hs')
-rw-r--r--tv/2configs/xserver/xmonad-tv/Util/Debunk.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tv/2configs/xserver/xmonad-tv/Util/Debunk.hs b/tv/2configs/xserver/xmonad-tv/Util/Debunk.hs
new file mode 100644
index 000000000..b4772e582
--- /dev/null
+++ b/tv/2configs/xserver/xmonad-tv/Util/Debunk.hs
@@ -0,0 +1,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
+