diff options
author | slotThe <soliditsallgood@mailbox.org> | 2021-07-06 09:23:37 +0200 |
---|---|---|
committer | slotThe <soliditsallgood@mailbox.org> | 2021-07-06 09:23:37 +0200 |
commit | f2907ced81dc25bfe19ba3bd705d3b60f33ee68d (patch) | |
tree | 30e4abb61a1942c8506ca77b3f6da63ffe24acfc /doc/screenshots/xmobar-top.png | |
parent | 12273cc0bf562b53d701fd0e8ccbbf67d40fd81b (diff) | |
download | xmobar-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 'doc/screenshots/xmobar-top.png')
0 files changed, 0 insertions, 0 deletions