diff options
author | Joey Hess <joey@kitenet.net> | 2012-12-13 00:29:06 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-12-13 00:29:06 -0400 |
commit | de6406afce6de0cf8a48bc2ecf9be1e7de93e40e (patch) | |
tree | 08705fab60c11d4073734a8c2500a88b1aab7852 /Utility/FreeDesktop.hs | |
parent | 3e55a8f164d67d5bd1ef86ae2f38fb2c6c3a51b2 (diff) | |
parent | 94554782894ec6c26da3b46312d5d1d16d596458 (diff) |
Merge branch 'master' into desymlink
Conflicts:
Annex/CatFile.hs
Annex/Content.hs
Git/LsFiles.hs
Git/LsTree.hs
Diffstat (limited to 'Utility/FreeDesktop.hs')
-rw-r--r-- | Utility/FreeDesktop.hs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Utility/FreeDesktop.hs b/Utility/FreeDesktop.hs index 7aba1f272..e3ced6d74 100644 --- a/Utility/FreeDesktop.hs +++ b/Utility/FreeDesktop.hs @@ -51,8 +51,8 @@ toString(NumericV f) = show f toString (ListV l) | null l = "" | otherwise = (intercalate ";" $ map (escapesemi . toString) l) ++ ";" - where - escapesemi = join "\\;" . split ";" + where + escapesemi = join "\\;" . split ";" genDesktopEntry :: String -> String -> Bool -> FilePath -> [String] -> DesktopEntry genDesktopEntry name comment terminal program categories = @@ -64,13 +64,13 @@ genDesktopEntry name comment terminal program categories = , item "Exec" StringV program , item "Categories" ListV (map StringV categories) ] - where - item x c y = (x, c y) + where + item x c y = (x, c y) buildDesktopMenuFile :: DesktopEntry -> String buildDesktopMenuFile d = unlines ("[Desktop Entry]" : map keyvalue d) ++ "\n" - where - keyvalue (k, v) = k ++ "=" ++ toString v + where + keyvalue (k, v) = k ++ "=" ++ toString v writeDesktopMenuFile :: DesktopEntry -> String -> IO () writeDesktopMenuFile d file = do @@ -115,11 +115,10 @@ userConfigDir = xdgEnvHome "CONFIG_HOME" ".config" - to ~/Desktop. -} userDesktopDir :: IO FilePath userDesktopDir = maybe fallback return =<< (parse <$> xdg_user_dir) - where - parse = maybe Nothing (headMaybe . lines) - xdg_user_dir = catchMaybeIO $ - readProcess "xdg-user-dir" ["DESKTOP"] - fallback = xdgEnvHome "DESKTOP_DIR" "Desktop" + where + parse = maybe Nothing (headMaybe . lines) + xdg_user_dir = catchMaybeIO $ readProcess "xdg-user-dir" ["DESKTOP"] + fallback = xdgEnvHome "DESKTOP_DIR" "Desktop" xdgEnvHome :: String -> String -> IO String xdgEnvHome envbase homedef = do |