aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Prompt/Man.hs
diff options
context:
space:
mode:
authorAdam Vogt <vogt.adam@gmail.com>2013-07-16 05:05:36 +0200
committerAdam Vogt <vogt.adam@gmail.com>2013-07-16 05:05:36 +0200
commit5d1ac7e93492b14b01bd66b67977e1fcf06dfa22 (patch)
tree2a23574037326748d6a6fcc1f13fb0f5cd7d5eff /XMonad/Prompt/Man.hs
parent4c2d70afa01c79c9de940c30046cd518b48436f8 (diff)
downloadXMonadContrib-5d1ac7e93492b14b01bd66b67977e1fcf06dfa22.tar.gz
XMonadContrib-5d1ac7e93492b14b01bd66b67977e1fcf06dfa22.tar.xz
XMonadContrib-5d1ac7e93492b14b01bd66b67977e1fcf06dfa22.zip
Fix issue 551 by also getting manpath without -g flag.
Ignore-this: ded2d51eb7b7697c0fdfaa8158d612df Instead of taking Ondrej's approach of figuring out which man (man-db or http://primates.ximian.com/~flucifredi/man/) is used by the system, just try both sets of flags. darcs-hash:20130716030536-1499c-7e886211a39a6576b40ed277811003d17f90ef88.gz
Diffstat (limited to 'XMonad/Prompt/Man.hs')
-rw-r--r--XMonad/Prompt/Man.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/XMonad/Prompt/Man.hs b/XMonad/Prompt/Man.hs
index 6cdaa66..4f6cf55 100644
--- a/XMonad/Prompt/Man.hs
+++ b/XMonad/Prompt/Man.hs
@@ -64,11 +64,15 @@ manPrompt c = do
getMans :: IO [String]
getMans = do
- paths <- getCommandOutput "manpath -g 2>/dev/null" `E.catch`
- \(E.SomeException _) -> return []
+ paths <- do
+ let getout cmd = getCommandOutput cmd `E.catch` \E.SomeException{} -> return ""
+ -- one of these combinations should give some output
+ p1 <- getout "manpath -g 2>/dev/null"
+ p2 <- getout "manpath 2>/dev/null"
+ return $ intercalate ":" $ lines $ p1 ++ p2
let sects = ["man" ++ show n | n <- [1..9 :: Int]]
dirs = [d ++ "/" ++ s | d <- split ':' paths, s <- sects]
- mans <- forM dirs $ \d -> do
+ mans <- forM (nub dirs) $ \d -> do
exists <- doesDirectoryExist d
if exists
then map (stripExt . stripSuffixes [".gz", ".bz2"]) `fmap`