summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorslotThe <soliditsallgood@mailbox.org>2021-07-06 09:23:37 +0200
committerslotThe <soliditsallgood@mailbox.org>2021-07-06 09:23:37 +0200
commitf2907ced81dc25bfe19ba3bd705d3b60f33ee68d (patch)
tree30e4abb61a1942c8506ca77b3f6da63ffe24acfc /src
parent12273cc0bf562b53d701fd0e8ccbbf67d40fd81b (diff)
downloadxmobar-f2907ced81dc25bfe19ba3bd705d3b60f33ee68d.tar.gz
xmobar-f2907ced81dc25bfe19ba3bd705d3b60f33ee68d.tar.bz2
Filter filename when executing Haskell-based config
We are now—in case the user specified a Haskell file as their xmobar configuration—threading the command line arguments that xmobar receives to the relevant execv() call. However, we simply shove in all arguments originally given to xmobar, including the path to the configuration file. As main is now defined within that very file, this seems unneccessary. By filtering out that part of the arguments, the pattern that a lot of users seem to follow for easy setting of certain options becomes a little bit nicer. For example: main :: IO () main = getArgs >>= \case ["-x", n, _] -> xmobar . config $ read n _ -> xmobar $ config 0 becomes main :: IO () main = getArgs >>= \case ["-x", n] -> xmobar . config $ read n _ -> xmobar $ config 0 Related: https://github.com/jaor/xmobar/pull/553
Diffstat (limited to 'src')
-rw-r--r--src/Xmobar/App/Main.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Xmobar/App/Main.hs b/src/Xmobar/App/Main.hs
index 16d5063..61604e0 100644
--- a/src/Xmobar/App/Main.hs
+++ b/src/Xmobar/App/Main.hs
@@ -106,5 +106,5 @@ xmobarMain = do
Just p -> do r <- readConfig defaultConfig p
case r of
Left e ->
- buildLaunch args (verboseFlag flags) (recompileFlag flags) p e
+ buildLaunch (filter (/= p) args) (verboseFlag flags) (recompileFlag flags) p e
Right (c, defs) -> doOpts c flags >>= xmobar' defs