summaryrefslogtreecommitdiff
path: root/Build/DesktopFile.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-07-09 20:50:41 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-07-09 20:50:41 -0400
commit68b3beefd87468204a8d8252d3487fae95b43f80 (patch)
treed43f937f543e7601e7952154fe434d9df148e36a /Build/DesktopFile.hs
parentd6922be2d1cac20b58750e1a76a3db684b8cca01 (diff)
linux standalone auto-install icons
Diffstat (limited to 'Build/DesktopFile.hs')
-rw-r--r--Build/DesktopFile.hs18
1 files changed, 3 insertions, 15 deletions
diff --git a/Build/DesktopFile.hs b/Build/DesktopFile.hs
index f3293d128..9f4ba5992 100644
--- a/Build/DesktopFile.hs
+++ b/Build/DesktopFile.hs
@@ -28,7 +28,6 @@ import System.Posix.Files
#endif
import System.FilePath
import Data.Maybe
-import System.IO
systemwideInstall :: IO Bool
#ifndef mingw32_HOST_OS
@@ -52,25 +51,14 @@ writeFDODesktop command = do
systemwide <- systemwideInstall
datadir <- if systemwide then return systemDataDir else userDataDir
- installMenu command
- =<< inDestDir (desktopMenuFilePath "git-annex" datadir)
-
- installIcon "doc/logo.svg"
- =<< inDestDir (iconFilePath "git-annex.svg" "scalable" datadir)
- installIcon "doc/favicon.png"
- =<< inDestDir (iconFilePath "git-annex.png" "16x16" datadir)
+ menufile <- inDestDir (desktopMenuFilePath "git-annex" datadir)
+ icondir <- inDestDir (iconDir datadir)
+ installMenu command menufile "doc" icondir
configdir <- if systemwide then return systemConfigDir else userConfigDir
installAutoStart command
=<< inDestDir (autoStartPath "git-annex" configdir)
-installIcon :: FilePath -> FilePath -> IO ()
-installIcon src dest = do
- createDirectoryIfMissing True (parentDir dest)
- withBinaryFile src ReadMode $ \hin ->
- withBinaryFile dest WriteMode $ \hout ->
- hGetContents hin >>= hPutStr hout
-
writeOSXDesktop :: FilePath -> IO ()
writeOSXDesktop command = do
installAutoStart command =<< inDestDir =<< ifM systemwideInstall