summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJochen Keil <jochen.keil@gmail.com>2012-08-09 09:43:49 +0200
committerJochen Keil <jochen.keil@gmail.com>2012-08-09 10:47:09 +0200
commit58427c76c892334522dfb28ea2d2a858469fc65a (patch)
tree4ed2294e0a0d7254fbeee5bbd7c53e35f675cd8c /src
parentcc77b5a7bc8309f694fd0aed4110b92f16316c0b (diff)
downloadxmobar-58427c76c892334522dfb28ea2d2a858469fc65a.tar.gz
xmobar-58427c76c892334522dfb28ea2d2a858469fc65a.tar.bz2
Cosmetic surgery
Realign methods, remove unnecessary imports and remove clutter
Diffstat (limited to 'src')
-rw-r--r--src/Commands.hs16
-rw-r--r--src/Main.hs2
-rw-r--r--src/Plugins/BufferedPipeReader.hs6
-rw-r--r--src/Window.hs1
4 files changed, 9 insertions, 16 deletions
diff --git a/src/Commands.hs b/src/Commands.hs
index f31c53c..b501022 100644
--- a/src/Commands.hs
+++ b/src/Commands.hs
@@ -35,14 +35,14 @@ import Signal
import XUtil
class Show e => Exec e where
- alias :: e -> String
- alias e = takeWhile (not . isSpace) $ show e
- rate :: e -> Int
- rate _ = 10
- run :: e -> IO String
- run _ = return ""
- start :: e -> (String -> IO ()) -> IO ()
- start e cb = go
+ alias :: e -> String
+ alias e = takeWhile (not . isSpace) $ show e
+ rate :: e -> Int
+ rate _ = 10
+ run :: e -> IO String
+ run _ = return ""
+ start :: e -> (String -> IO ()) -> IO ()
+ start e cb = go
where go = run e >>= cb >> tenthSeconds (rate e) >> go
trigger :: e -> (Maybe SignalType -> IO ()) -> IO ()
trigger _ sh = sh Nothing
diff --git a/src/Main.hs b/src/Main.hs
index c7045b5..5ef5db6 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -36,7 +36,7 @@ import System.Environment
import System.Posix.Files
import Control.Monad (unless)
-import Signal (setupSignalHandler, SignalType(..))
+import Signal (setupSignalHandler)
-- $main
diff --git a/src/Plugins/BufferedPipeReader.hs b/src/Plugins/BufferedPipeReader.hs
index 1fb9dcb..e232916 100644
--- a/src/Plugins/BufferedPipeReader.hs
+++ b/src/Plugins/BufferedPipeReader.hs
@@ -18,18 +18,12 @@ import Control.Monad(forM_, when)
import Control.Concurrent
import Control.Concurrent.STM
import System.IO
--- import System.IO.Unsafe(unsafePerformIO)
import Plugins
data BufferedPipeReader = BufferedPipeReader String [(Int, String)]
deriving (Read, Show)
--- pipeState :: MVar String
--- pipeState = unsafePerformIO $ newMVar ""
-
--- pipe :: (String -> IO ()) -> Handle -> IO ()
--- pipe cb h = hGetLineSafe h >>= cb
instance Exec BufferedPipeReader where
alias ( BufferedPipeReader a _ ) = a
diff --git a/src/Window.hs b/src/Window.hs
index e59c5ff..9024fff 100644
--- a/src/Window.hs
+++ b/src/Window.hs
@@ -5,7 +5,6 @@ import Graphics.X11.Xlib hiding (textExtents, textWidth)
import Graphics.X11.Xlib.Extras
import Graphics.X11.Xinerama
-import Control.Monad.Reader
import Data.Maybe(fromMaybe)
import System.Posix.Process (getProcessID)