diff options
author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2008-03-16 17:46:42 +0100 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2008-03-16 17:46:42 +0100 |
commit | 641836613311563d560baa32aab30ba4997bbf59 (patch) | |
tree | e57f300823679bba8a62c74c062e744c868ea275 | |
parent | 7a7e4aa53317e8bba1c6781e65ec8274c1e58524 (diff) | |
download | xmobar-641836613311563d560baa32aab30ba4997bbf59.tar.gz xmobar-641836613311563d560baa32aab30ba4997bbf59.tar.bz2 |
README: updated to latest changes
darcs-hash:20080316164642-d6583-492d9a612e3ddb8bcee6d658bf940f7a2481f123.gz
-rw-r--r-- | README | 105 |
1 files changed, 74 insertions, 31 deletions
@@ -13,6 +13,8 @@ through plugins. [This is a screen shot] of my desktop with [XMonad] and [Xmobar]. +[Xmobar] supports XFT and UTF-8 locales. + See `xmobar.config-sample`, distributed with the source code, for a sample configuration. @@ -50,9 +52,12 @@ To install simply run: tar xvfz xmobar-0.8 cd xmobar-0.8 - runhaskell Setup.lhs configure --prefix=/usr/local + runhaskell Setup.lhs configure + # Or, to enable UTF-8 support: + # runhaskell Setup.lhs configure --flags="with_utf8" + # Or, to enable XFT and UTF-8 support: + # runhaskell Setup.lhs configure --flags="use_xft" runhaskell Setup.lhs build - runhaskell Setup.lhs haddock --executables # optional runhaskell Setup.lhs install # possibly to be run as root Run with: @@ -65,6 +70,30 @@ or if you have the default configuration file saved as `~/.xmobarrc` +Utf-8 and Xft Support +--------------------- + +[Xmobar] can be compiled with UTF-8 and XFT support. If you want UTF-8 +support only, you just need to run the configuration script with the +`"with_utf"` flag: + + runhaskell Setup.lhs configure --flags="with_utf8" + +This requires the presence of [utf8-string] package. + +XFT support, which will also enable UTF-8 support, requires the +[X11-xft] package too and is enabled by running the configuration +script with the `"use_xft"` flag: + + runhaskell Setup.lhs configure --flags="use_xft" + +Then build [Xmobar] as usual. + +To use XFT fonts you need to use the `xft:` prefix in the `font` +configuration option. For instance: + + font = "xft:Times New Roman-10:italic" + Configuration ------------- @@ -83,13 +112,13 @@ For the output template: Other configuration options: `font` -: Name of the font to be used +: Name of the font to be used. Use the `xft:` prefix for XFT fonts. -`bgColor` -: Background color +`bgColor` +: Background color. -`fgColor` -: Default font color +`fgColor` +: Default font color. `position` : Top, TopW, Bottom, BottomW or Static (with x, y, width and height). @@ -97,13 +126,13 @@ Other configuration options: : TopW and BottomW take 2 arguments: an alignment parameter (L for left, C for centered, R for Right) and an integer for the percentage width Xmobar window will have in respect to the - screen width + screen width. : For example: : position = Bottom C 75 -: to place Xmobar at the bottom, centered with the 75% of the screen width. +: to place Xmobar at the bottom, centered with the 75% of the screen width. : Or @@ -114,20 +143,20 @@ Other configuration options: : position = Top `commands` -: For setting the options of the programs to run (optional) +: For setting the options of the programs to run (optional). -`sepChar` +`sepChar` : The character to be used for indicating commands in the output - template (default '%') + template (default '%'). `alignSep` : a 2 character string for aligning text in the output template. The text before the first character will be align to left, the text in between the 2 characters will be centered, and the text after the - second character will be align to the right. + second character will be align to the right. `template` -: The output template +: The output template. ### Command Line Options @@ -140,7 +169,7 @@ Example: xmobar -B white -a right -F blue -t '%LIPB%' -c '[Run Weather "LIPB" [] 36000]' -This is the list of command line options (the output of +This is the list of command line options (the output of xmobar --help): Usage: xmobar [OPTION...] [FILE] @@ -173,7 +202,7 @@ If no command is found in the `commands` list, [Xmobar] will ask the operating system to execute a program with the name found in the template. If the execution is not successful an error will be reported. - + ### The `commands` Configuration Option The `commands` configuration option is a list of commands information @@ -217,7 +246,7 @@ Monitors have default aliases. - aliases to the Station ID: so `Weather "LIPB" []` can be used in template as `%LIBP%` - Args: the argument list (see below) -- Variables that can be used with the `-t`/`--template` argument: +- Variables that can be used with the `-t`/`--template` argument: `station`, `stationState`, `year`, `month`, `day`, `hour`, `wind`, `visibility`, `skyCondition`, `tempC`, `tempF`, `dewPoint`, `rh`, `pressure` @@ -229,7 +258,7 @@ Monitors have default aliases. - aliases to the interface name: so `Network "eth0" []` can be used as `%eth0%` - Args: the argument list (see below) -- Variables that can be used with the `-t`/`--template` argument: +- Variables that can be used with the `-t`/`--template` argument: `dev`, `rx`, `tx` - Default template: `<dev>: <rx>|<tx>` @@ -237,7 +266,7 @@ Monitors have default aliases. - aliases to `memory` - Args: the argument list (see below) -- Variables that can be used with the `-t`/`--template` argument: +- Variables that can be used with the `-t`/`--template` argument: `total`, `free`, `buffer`, `cache`, `rest`, `used`, `usedratio` - Default template: `Mem: <usedratio>% (<cache>M)` @@ -245,7 +274,7 @@ Monitors have default aliases. - aliases to `swap` - Args: the argument list (see below) -- Variables that can be used with the `-t`/`--template` argument: +- Variables that can be used with the `-t`/`--template` argument: `total`, `used`, `free`, `usedratio` - Default template: `Swap: <usedratio>%` @@ -253,7 +282,7 @@ Monitors have default aliases. - aliases to `cpu` - Args: the argument list (see below) -- Variables that can be used with the `-t`/`--template` argument: +- Variables that can be used with the `-t`/`--template` argument: `total`, `user`, `nice`, `system`, `idle` - Default template: `Cpu: <total>` @@ -261,7 +290,19 @@ Monitors have default aliases. - aliases to `battery` - Args: the argument list (see below) -- Variables that can be used with the `-t`/`--template` argument: +- Variables that can be used with the `-t`/`--template` argument: + `left` +- Default template: `Batt: <left>` + +`BatteryP Dirs Args RefreshRate` + +- aliases to `battery` +- Files: list of directories in /proc/acpi/battery/ direcotry where to + look for the `state` and `info` files. Example: + `["BAT0","BAT1","BAT2"]`. Only the first 3 directories will be + searched. +- Args: the argument list (see below) +- Variables that can be used with the `-t`/`--template` argument: `left` - Default template: `Batt: <left>` @@ -274,7 +315,7 @@ Monitors have default aliases. - Default template: `Thm: <temp>C` - This plugin works only on sytems with devices having thermal zone. Check directories in /proc/acpi/thermal_zone for possible values. -- Example: Run Thermal "THRM" ["-t","iwl4965-temp: \<temp\>C"] +- Example: `Run Thermal "THRM" ["-t","iwl4965-temp: \<temp\>C"]` `CpuFreq Args RefreshRate` @@ -284,7 +325,7 @@ Monitors have default aliases. `cpu0`, `cpu1`, .., `cpuN` - Default template: `Freq: <cpu0>GHz` - This monitor requires acpi_cpufreq module to be loaded in kernel -- Example: Run CpuFreq ["-t","Freq:\<cpu0\>|\<cpu1\>GHz","-L","0","-H","2","-l","lightblue","-n","white","-h","red"] 50 +- Example: `Run CpuFreq ["-t","Freq:\<cpu0\>|\<cpu1\>GHz","-L","0","-H","2","-l","lightblue","-n","white","-h","red"] 50` `CoreTemp Args RefreshRate` @@ -294,7 +335,7 @@ Monitors have default aliases. `core0`, `core1`, .., `coreN` - Default template: `Temp: <core0>C` - This monitor requires coretemp module to be loaded in kernel -- Example: Run CoreTemp ["-t","Temp:\<core0\>|\<core1\>C","-L","40","-H","60","-l","lightblue","-n","gray90","-h","red"] 50 +- Example: `Run CoreTemp ["-t","Temp:\<core0\>|\<core1\>C","-L","40","-H","60","-l","lightblue","-n","gray90","-h","red"] 50` ### Monitor Plugins Commands Arguments @@ -385,7 +426,7 @@ Notice that Date could be implemented as: instance Exec Date where alias (Date _ a _) = a start (Date f _ r) = date f r - + date :: String -> Int -> (String -> IO ()) -> IO () date format r callback = do go where go = do @@ -420,8 +461,8 @@ plugins that are distributed with [Xmobar]. Installing a plugin should require 3 steps. Here we are going to install the HelloWorld plugin that comes with [Xmobar]: -1. import the plugin module in `Config.hs`, by adding: - +1. import the plugin module in `Config.hs`, by adding: + import Plugins.HelloWorld 2. add the plugin data type to the list of data types in the type @@ -475,7 +516,7 @@ understanding how X works. They gave me suggestions on how to solve many problems with [Xmobar]. Thanks to Claus Reinke for make me understand existential types (or at -least for letting me think I grasp existential types...;-). +least for letting me think I grasp existential types...;-). [Xmobar] incorporates patches from: Krzysztof Kosciuszkiewicz, Spencer Janssen, Jens Petersen, Dmitry Kurochkin, and Lennart Kolmodin. @@ -495,7 +536,7 @@ this tutorial [on X Window Programming in Haskell]. Author ------ -Andrea Rossato +Andrea Rossato `andrea.rossato at unibz.it` @@ -513,4 +554,6 @@ Copyright © 2007 Andrea Rossato [Xmobars darcs repository]: http://code.haskell.org/xmobar [on X Window Programming in Haskell]: http://www.haskell.org/haskellwiki/X_window_programming_in_Haskell [Ion3]: http://modeemi.fi/~tuomov/ion/ -[XMonad]: http://xmonad.org
\ No newline at end of file +[XMonad]: http://xmonad.org +[utf8-string]: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/utf8-string +[X11-xft]: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/X11-xft |