summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorThiago Negri <evohunz@gmail.com>2013-10-29 21:40:50 -0200
committerThiago Negri <evohunz@gmail.com>2013-10-29 22:08:38 -0200
commit1563fa8473d728486b7c86a1a4f818466ab64413 (patch)
tree2d2f7afd4e67fc32aea5adb6cbe0c249da33f203 /src
parenteaccf70440e24ac90f9d0ad948c262ba084659dc (diff)
downloadxmobar-1563fa8473d728486b7c86a1a4f818466ab64413.tar.gz
xmobar-1563fa8473d728486b7c86a1a4f818466ab64413.tar.bz2
Fixed #133: xmobar was not reading ~/.xmobarrc
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs16
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