summaryrefslogtreecommitdiff
path: root/Utility/FreeDesktop.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 /Utility/FreeDesktop.hs
parentd6922be2d1cac20b58750e1a76a3db684b8cca01 (diff)
linux standalone auto-install icons
Diffstat (limited to 'Utility/FreeDesktop.hs')
-rw-r--r--Utility/FreeDesktop.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/Utility/FreeDesktop.hs b/Utility/FreeDesktop.hs
index 9ed92a77b..da9d7b618 100644
--- a/Utility/FreeDesktop.hs
+++ b/Utility/FreeDesktop.hs
@@ -17,6 +17,7 @@ module Utility.FreeDesktop (
writeDesktopMenuFile,
desktopMenuFilePath,
autoStartPath,
+ iconDir,
iconFilePath,
systemDataDir,
systemConfigDir,
@@ -93,13 +94,17 @@ autoStartPath :: String -> FilePath -> FilePath
autoStartPath basename configdir =
configdir </> "autostart" </> desktopfile basename
-{- Path to use for an icon file, in either the systemDataDir
- - or the userDatadir.
+{- Base directory to install an icon file, in either the systemDataDir
+ - or the userDatadir. -}
+iconDir :: FilePath -> FilePath
+iconDir datadir = datadir </> "icons" </> "hicolor"
+
+{- Filename of an icon, given the iconDir to use.
-
- The resolution is something like "48x48" or "scalable". -}
iconFilePath :: FilePath -> String -> FilePath -> FilePath
-iconFilePath file resolution datadir = datadir </> "icons" </>
- "hicolor" </> resolution </> "apps" </> file
+iconFilePath file resolution icondir =
+ icondir </> resolution </> "apps" </> file
desktopfile :: FilePath -> FilePath
desktopfile f = f ++ ".desktop"