 |Kill the statusbar handlers by closing one's pipe and killing the other.
killStatusProcs :: Handle -> ProcessID -> IO ()
killStatusProcs h pid = do
    E.handle printException $ hFlush h
    E.handle printException $ hClose h
    pgid <- getPGID pid
    E.handle printException $ either E.throw (signalProcessGroup sigTERM) pgid
        where
            getPGID :: ProcessID -> IO (Either E.SomeException ProcessGroupID)
            getPGID = E.try . getProcessGroupIDOf
            printException :: E.SomeException -> IO ()
            printException = putStrLn . show

-- |Modifies an XConfig to install a handler for XMONAD_RESTART events.
w
killStatusProcs :: Handle -> ProcessID -> IO ()
killStatusProcs h pid = do
    E.handle printException $ hFlush h
    E.handle printException $ hClose h
    pgid <- getPGID pid
    E.handle printException $ either E.throw (signalProcessGroup sigTERM) pgid
        where
            getPGID :: ProcessID -> IO (Either E.SomeException ProcessGroupID)
            getPGID = E.try . getProcessGroupIDOf
            printException :: E.SomeException -> IO ()
            printException = putStrLn . show

-- |Modifies an XConfig to install a handler for XMONAD_RESTART events.
killStatusProcs h pid = do
    E.handle printException $ hFlush h
    E.handle printException $ hClose h
    pgid <- getPGID pid
    E.handle printException $ either E.throw (signalProcessGroup sigTERM) pgid
        where
            getPGID :: ProcessID -> IO (Either E.SomeException ProcessGroupID)
            getPGID = E.try . getProcessGroupIDOf
            printException :: E.SomeException -> IO ()
            printException = putStrLn . show

-- |Modifies an XConfig to install a handler for XMONAD_RESTART events.