drop xdg-basedir dependency
This commit is contained in:
parent
d1ece3796d
commit
62953174b4
13
Main.hs
13
Main.hs
@ -9,15 +9,14 @@ import Data.Configurator
|
|||||||
import Control.Monad (mapM_, filterM)
|
import Control.Monad (mapM_, filterM)
|
||||||
import Control.Monad.Reader (ReaderT, runReaderT, asks)
|
import Control.Monad.Reader (ReaderT, runReaderT, asks)
|
||||||
import System.FilePath (joinPath, takeBaseName, (</>))
|
import System.FilePath (joinPath, takeBaseName, (</>))
|
||||||
import System.Directory (removeFile, getDirectoryContents, doesFileExist)
|
|
||||||
import System.IO (readFile)
|
import System.IO (readFile)
|
||||||
|
import System.Directory
|
||||||
|
|
||||||
import Database.Selda
|
import Database.Selda
|
||||||
import Database.Selda.SQLite
|
import Database.Selda.SQLite
|
||||||
|
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import qualified Data.Text.IO as T
|
import qualified Data.Text.IO as T
|
||||||
import qualified System.Environment.XDG.BaseDir as X
|
|
||||||
|
|
||||||
|
|
||||||
data Settings = Settings
|
data Settings = Settings
|
||||||
@ -38,7 +37,7 @@ type Action = ReaderT Settings IO
|
|||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
config <- X.getUserConfigFile "bisc" "bisc.conf"
|
config <- getXdgDirectory XdgConfig ("bisc" </> "bisc.conf")
|
||||||
settings <- loadSettings config
|
settings <- loadSettings config
|
||||||
runReaderT clean settings
|
runReaderT clean settings
|
||||||
|
|
||||||
@ -112,8 +111,8 @@ deleteData whitelist = do
|
|||||||
|
|
||||||
loadSettings :: FilePath -> IO Settings
|
loadSettings :: FilePath -> IO Settings
|
||||||
loadSettings path = do
|
loadSettings path = do
|
||||||
configdir <- X.getUserConfigDir "qutebrowser"
|
configdir <- getXdgDirectory XdgConfig "qutebrowser"
|
||||||
datadir <- X.getUserDataDir "qutebrowser"
|
datadir <- getXdgDirectory XdgData "qutebrowser"
|
||||||
let
|
let
|
||||||
defaultWhitelist = joinPath [configdir, "whitelists", "cookies"]
|
defaultWhitelist = joinPath [configdir, "whitelists", "cookies"]
|
||||||
defaultWebengine = joinPath [datadir, "webengine"]
|
defaultWebengine = joinPath [datadir, "webengine"]
|
||||||
|
@ -25,8 +25,8 @@ executable bisc
|
|||||||
main-is: Main.hs
|
main-is: Main.hs
|
||||||
build-depends: base ==4.* , selda ==0.3.*,
|
build-depends: base ==4.* , selda ==0.3.*,
|
||||||
selda-sqlite ==0.1.*,
|
selda-sqlite ==0.1.*,
|
||||||
xdg-basedir, filepath, directory,
|
filepath, directory, text,
|
||||||
text, mtl, configurator
|
mtl, configurator
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
default-extensions: DeriveGeneric, OverloadedStrings
|
default-extensions: DeriveGeneric, OverloadedStrings
|
||||||
OverloadedLabels, FlexibleContexts
|
OverloadedLabels, FlexibleContexts
|
||||||
|
Loading…
Reference in New Issue
Block a user