summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2014-09-26 02:52:00 +0200
committerjao <jao@gnu.org>2014-09-26 02:52:00 +0200
commita04850b0cbe4355dc7bd083a353fabdc644a24fb (patch)
tree8bc1edbc1fb14e942e7c5f226aba7f11756c15d3
parent05554f239c79d738848f5453b16b8ad01e9a5f50 (diff)
downloadxmobar-a04850b0cbe4355dc7bd083a353fabdc644a24fb.tar.gz
xmobar-a04850b0cbe4355dc7bd083a353fabdc644a24fb.tar.bz2
CLI switch for iconRoot (-i)
-rw-r--r--readme.md6
-rw-r--r--samples/xmobar.config16
-rw-r--r--src/Main.hs4
3 files changed, 20 insertions, 6 deletions
diff --git a/readme.md b/readme.md
index 1cc1d00..4eec680 100644
--- a/readme.md
+++ b/readme.md
@@ -321,8 +321,9 @@ Other configuration options:
`iconRoot`
: Root folder where icons are stored. For <icon=path/>
- if path start with `"/"`, `"./"` or `"../"` it is interpreted as it is.
- Otherwise it will have `iconRoot ++ "/"` prepended to it. Default is `"."`.
+ if path start with `"/"`, `"./"` or `"../"` it is interpreted as
+ it is. Otherwise it will have `iconRoot ++ "/"` prepended to
+ it. Default is `"."`.
`commands`
: For setting the options of the programs to run (optional).
@@ -377,6 +378,7 @@ xmobar --help):
-s char --sepchar=char The character used to separate commands in
the output template. Default '%'
-t template --template=template The output template
+ -i path --iconroot=path Default directory for icon pattern files
-c commands --commands=commands The list of commands to be executed
-C command --add-command=command Add to the list of commands to be executed
-x screen --screen=screen On which X screen number to start
diff --git a/samples/xmobar.config b/samples/xmobar.config
index 5f4c224..9b1fbc2 100644
--- a/samples/xmobar.config
+++ b/samples/xmobar.config
@@ -8,10 +8,18 @@ Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*"
, pickBroadest = False
, persistent = False
, hideOnStart = False
- , commands = [ Run Weather "EGPF" ["-t","<station>: <tempC>C","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 36000
- , Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10
- , Run Network "eth1" ["-L","0","-H","32","--normal","green","--high","red"] 10
- , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
+ , iconRoot = "."
+ , commands = [ Run Weather "EGPF" ["-t","<station>: <tempC>C",
+ "-L","18","-H","25",
+ "--normal","green",
+ "--high","red",
+ "--low","lightblue"] 36000
+ , Run Network "eth0" ["-L","0","-H","32",
+ "--normal","green","--high","red"] 10
+ , Run Network "eth1" ["-L","0","-H","32",
+ "--normal","green","--high","red"] 10
+ , Run Cpu ["-L","3","-H","50",
+ "--normal","green","--high","red"] 10
, Run Memory ["-t","Mem: <usedratio>%"] 10
, Run Swap [] 10
, Run Com "uname" ["-s","-r"] "" 36000
diff --git a/src/Main.hs b/src/Main.hs
index f3885ff..5266cd1 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -130,6 +130,7 @@ data Opts = Help
| SepChar String
| Template String
| OnScr String
+ | IconRoot String
deriving Show
options :: [OptDescr Opts]
@@ -141,6 +142,8 @@ options =
"The background color. Default black"
, Option "F" ["fgcolor"] (ReqArg FgColor "fg color")
"The foreground color. Default grey"
+ , Option "i" ["iconroot"] (ReqArg IconRoot "path")
+ "Root directory for icon pattern paths. Default '.'"
, Option "o" ["top"] (NoArg T) "Place xmobar at the top of the screen"
, Option "b" ["bottom"] (NoArg B)
"Place xmobar at the bottom of the screen"
@@ -203,6 +206,7 @@ doOpts conf (o:oo) =
AlignSep s -> doOpts' (conf {alignSep = s})
SepChar s -> doOpts' (conf {sepChar = s})
Template s -> doOpts' (conf {template = s})
+ IconRoot s -> doOpts' (conf {iconRoot = s})
OnScr n -> doOpts' (conf {position = OnScreen (read n) $ position conf})
Commands s -> case readCom 'c' s of
Right x -> doOpts' (conf {commands = x})