diff options
author | 2016-09-22 11:29:53 -0400 | |
---|---|---|
committer | 2016-09-22 11:29:53 -0400 | |
commit | 97896a2f0be1e7076cf311b437e18b347b235d63 (patch) | |
tree | 6dd84f32ee3c50d1595c0391bba54973748a01cd | |
parent | be43649a03543857c4af855d62540ca900f202e2 (diff) |
avoid needing PartialPrelude
-rw-r--r-- | Utility/FreeDesktop.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Utility/FreeDesktop.hs b/Utility/FreeDesktop.hs index 67f6219bd..9863198db 100644 --- a/Utility/FreeDesktop.hs +++ b/Utility/FreeDesktop.hs @@ -31,7 +31,6 @@ module Utility.FreeDesktop ( import Utility.Exception import Utility.UserInfo import Utility.Process -import Utility.PartialPrelude import Utility.Directory import System.Environment @@ -135,7 +134,9 @@ userConfigDir = xdgEnvHome "CONFIG_HOME" ".config" userDesktopDir :: IO FilePath userDesktopDir = maybe fallback return =<< (parse <$> xdg_user_dir) where - parse = maybe Nothing (headMaybe . lines) + parse s = case lines <$> s of + Just (l:_) -> Just l + _ -> Nothing xdg_user_dir = catchMaybeIO $ readProcess "xdg-user-dir" ["DESKTOP"] fallback = xdgEnvHome "DESKTOP_DIR" "Desktop" |