diff options
author | Marco TĂșlio Gontijo e Silva <marcot@riseup.net> | 2008-07-10 15:53:42 +0200 |
---|---|---|
committer | Marco TĂșlio Gontijo e Silva <marcot@riseup.net> | 2008-07-10 15:53:42 +0200 |
commit | 6c0021d7d8fa8501c1743029734ba34f93c04f27 (patch) | |
tree | 2a8a7fdad0f45aaed288b56558e98d0bccb782c6 /XMonad | |
parent | 570a81e6acc1ad4dd1c5a62a6f5a6432d090e409 (diff) | |
download | XMonadContrib-6c0021d7d8fa8501c1743029734ba34f93c04f27.tar.gz XMonadContrib-6c0021d7d8fa8501c1743029734ba34f93c04f27.tar.xz XMonadContrib-6c0021d7d8fa8501c1743029734ba34f93c04f27.zip |
XMonad.Actions.Plane: Treat error in read
darcs-hash:20080710135342-7641b-c984b88b12655b15274003771ff981d4bed36794.gz
Diffstat (limited to 'XMonad')
-rw-r--r-- | XMonad/Actions/Plane.hs | 18 |
1 files changed, 15 insertions, 3 deletions
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 |