diff options
author | Thiago Negri <evohunz@gmail.com> | 2013-10-29 21:40:50 -0200 |
---|---|---|
committer | Thiago Negri <evohunz@gmail.com> | 2013-10-29 22:08:38 -0200 |
commit | 1563fa8473d728486b7c86a1a4f818466ab64413 (patch) | |
tree | 2d2f7afd4e67fc32aea5adb6cbe0c249da33f203 | |
parent | eaccf70440e24ac90f9d0ad948c262ba084659dc (diff) | |
download | xmobar-1563fa8473d728486b7c86a1a4f818466ab64413.tar.gz xmobar-1563fa8473d728486b7c86a1a4f818466ab64413.tar.bz2 |
Fixed #133: xmobar was not reading ~/.xmobarrc
-rw-r--r-- | src/Main.hs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Main.hs b/src/Main.hs index d0fe4fc..a3c60c3 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -105,14 +105,16 @@ getXdgConfigFile = xmobarConfigDir >>= return . (</> "xmobarrc") -- | Read default configuration file or load the default config readDefaultConfig :: IO (Config,[String]) readDefaultConfig = do - xdgconf <- getXdgConfigFile - x <- io $ fileExist xdgconf + xdgConfigFile <- getXdgConfigFile + xdgConfigFileExists <- io $ fileExist xdgConfigFile home <- io $ getEnv "HOME" - let path = home ++ "/.xmobarrc" - f <- io $ fileExist xdgconf - if x then readConfig path - else if f then readConfig path - else return (defaultConfig,[]) + let defaultConfigFile = home ++ "/.xmobarrc" + defaultConfigFileExists <- io $ fileExist defaultConfigFile + if xdgConfigFileExists + then readConfig xdgConfigFile + else if defaultConfigFileExists + then readConfig defaultConfigFile + else return (defaultConfig,[]) data Opts = Help | Version |