standalone linux app nearly ready
also made several fixes that apply to the OSX app
This commit is contained in:
parent
f0d75cd928
commit
e88e3ba85b
11 changed files with 187 additions and 20 deletions
|
@ -1,23 +1,37 @@
|
|||
{- Assistant OSX autostart file installation
|
||||
{- Assistant autostart file installation
|
||||
-
|
||||
- Copyright 2012 Joey Hess <joey@kitenet.net>
|
||||
-
|
||||
- Licensed under the GNU GPL version 3 or higher.
|
||||
-}
|
||||
|
||||
{-# LANGUAGE CPP #-}
|
||||
|
||||
module Assistant.Install.AutoStart where
|
||||
|
||||
import Utility.FreeDesktop
|
||||
import Utility.OSX
|
||||
import Utility.Path
|
||||
|
||||
import System.Directory
|
||||
|
||||
{- Installs an autostart plist file for OSX. -}
|
||||
installAutoStart :: FilePath -> FilePath -> IO ()
|
||||
installAutoStart command file = do
|
||||
#ifdef darwin_HOST_OS
|
||||
createDirectoryIfMissing True (parentDir file)
|
||||
writeFile file $ genOSXAutoStartFile autoStartLabel command
|
||||
writeFile file $ genOSXAutoStartFile osxAutoStartLabel command
|
||||
["assistant", "--autostart"]
|
||||
#else
|
||||
writeDesktopMenuFile (fdoAutostart command) file
|
||||
#endif
|
||||
|
||||
autoStartLabel :: String
|
||||
autoStartLabel = "com.branchable.git-annex.assistant"
|
||||
osxAutoStartLabel :: String
|
||||
osxAutoStartLabel = "com.branchable.git-annex.assistant"
|
||||
|
||||
fdoAutostart :: FilePath -> DesktopEntry
|
||||
fdoAutostart command = genDesktopEntry
|
||||
"Git Annex Assistant"
|
||||
"Autostart"
|
||||
False
|
||||
(command ++ " assistant --autostart")
|
||||
[]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue