diff options
Diffstat (limited to 'doc/using-haskell.org')
| -rw-r--r-- | doc/using-haskell.org | 22 | 
1 files changed, 15 insertions, 7 deletions
| diff --git a/doc/using-haskell.org b/doc/using-haskell.org index 4020557..9fd3d88 100644 --- a/doc/using-haskell.org +++ b/doc/using-haskell.org @@ -26,7 +26,7 @@      config :: Config      config =        defaultConfig -        { font = "xft:Terminus-8", +        { font = "DejaVu Sans Mono 9",            allDesktops = True,            alpha = 200,            commands = @@ -40,7 +40,7 @@          }      main :: IO () -    main = xmobar config +    main = xmobar config  -- or: configFromArgs config >>= xmobar    #+end_src    You can then for instance run =ghc --make xmobar.hs= to create a new xmobar @@ -49,6 +49,14 @@    system-wide xmobar, it will notice that you have your own implementation    and (re)compile and run it as needed. +* Using dynamic linking + +  Setting the =with_shared= flag, which is off by default, enables (re)building +  of xmobar with shared libraries. By default, =xmobar= rebuilds itself with +  static linking, as is the common practice with Haskell programs, but some +  distributions use dynamic linking in their packages, or you might also be so +  inclined. If so, this is your flag. +  * Writing a plugin    :PROPERTIES:    :CUSTOM_ID: writing-a-plugin @@ -75,8 +83,8 @@    =run= can be used for simpler plugins. If you define only =run= the plugin    will be run every second. To overwrite this default you just need to    implement =rate=, which must return the number of tenth of seconds between -  every successive runs. See [[../etc/xmobar.hs][etc/xmobar.hs]] for an example of a plugin -  that runs just once, and [[../src/Xmobar/Plugins/Date.hs][src/Xmobar/Plugins/Date.hs]] for one that +  every successive runs. See [[https://codeberg.org/xmobar/xmobar/src/branch/master/etc/xmobar.hs][etc/xmobar.hs]] for an example of a plugin +  that runs just once, and [[https://codeberg.org/xmobar/xmobar/src/branch/master/src/Xmobar/Plugins/Date.hs][src/Xmobar/Plugins/Date.hs]] for one that    implements =rate=.    Notice that Date could be implemented as: @@ -107,14 +115,14 @@    If your plugin only implements =alias= and =start=, then it is advisable to    put it into the =Xmobar/Plugins/Monitors= directory and use one of the many -  =run*= functions in [[../src/Xmobar/Plugins/Monitors/Common/Run.hs][Xmobar.Plugins.Monitors.Run]] in order to define -  =start=. The =Exec= instance should then live in [[../src/Xmobar/Plugins/Monitors.hs][Xmobar.Plugins.Monitors]]. +  =run*= functions in [[https://codeberg.org/xmobar/xmobar/src/branch/master/src/Xmobar/Plugins/Monitors/Common/Run.hs][Xmobar.Plugins.Monitors.Run]] in order to define +  =start=. The =Exec= instance should then live in [[https://codeberg.org/xmobar/xmobar/src/branch/master/src/Xmobar/Plugins/Monitors.hs][Xmobar.Plugins.Monitors]].  * Using a plugin    To use your new plugin, you just need to use a pure Haskell configuration    for xmobar (as explained [[#xmobar-in-haskell][above]]) and load your definitions in your =xmobar.hs= -  file. You can see an example in [[../etc/xmobar.hs][etc/xmobar.hs]] showing you how to write +  file. You can see an example in [[https://codeberg.org/xmobar/xmobar/src/branch/master/etc/xmobar.hs][etc/xmobar.hs]] showing you how to write    a Haskell configuration that uses a new plugin, all in one file.    When xmobar runs with the full path to that Haskell file as its argument | 
