From 6c0021d7d8fa8501c1743029734ba34f93c04f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20T=C3=BAlio=20Gontijo=20e=20Silva?= Date: Thu, 10 Jul 2008 15:53:42 +0200 Subject: XMonad.Actions.Plane: Treat error in read darcs-hash:20080710135342-7641b-c984b88b12655b15274003771ff981d4bed36794.gz --- XMonad/Actions/Plane.hs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'XMonad/Actions/Plane.hs') diff --git a/XMonad/Actions/Plane.hs b/XMonad/Actions/Plane.hs index 8de7ab6..edf5dc3 100644 --- a/XMonad/Actions/Plane.hs +++ b/XMonad/Actions/Plane.hs @@ -126,9 +126,15 @@ plane function numberLines_ limits direction = do GConf -> do numberLines__ <- - runProcessWithInput "gconftool-2" - ["--get", "/apps/panel/applets/workspace_switcher_screen0/prefs/num_rows"] "" - return $ read numberLines__ + runProcessWithInput gconftool parameters "" + case reads numberLines__ of + [(numberRead, _)] -> return numberRead + _ -> + do + trace $ + "XMonad.Actions.Plane: Could not parse the output of " ++ gconftool ++ + unwords parameters ++ ": " ++ numberLines__ ++ "; assuming 1." + return 1 let horizontal f = @@ -167,3 +173,9 @@ plane function numberLines_ limits direction = do ToDown -> run (currentWS + columns < areas) $ vertical (+) ToLeft -> run (column /= 0 ) $ horizontal pred ToRight -> run (column /= columns - 1 ) $ horizontal succ + +gconftool :: String +gconftool = "gconftool-2" + +parameters :: [String] +parameters = ["--get", "/apps/panel/applets/workspace_switcher_screen0/prefs/num_rows"] \ No newline at end of file -- cgit v1.2.3