diff options
author | Pavan Rikhi <pavan.rikhi@gmail.com> | 2020-04-09 13:51:37 -0400 |
---|---|---|
committer | jao <jao@gnu.org> | 2020-04-12 01:31:51 +0100 |
commit | 80913aeed46fc607f057a77ffdd884b5db77a0bc (patch) | |
tree | b81dbe7fa9cea64d1431c13bb813e7043bc8faaa /readme.md | |
parent | dcbbf50dd474d8ea2822a31ed2c8affad828d8d1 (diff) | |
download | xmobar-80913aeed46fc607f057a77ffdd884b5db77a0bc.tar.gz xmobar-80913aeed46fc607f057a77ffdd884b5db77a0bc.tar.bz2 |
Add a HandleReader Plugin
This adds a new `HandleReader` plugin, which displays data from a
Haskell `Handle`. This is really only useful if you are running xmobar
from within another Haskell program, but lets you avoid the mechanics of
creating a named pipe with the proper file permissions.
Instead, you can use `System.Process.createPipe` to make a pair of read
& write Handles. If you pass the read handle to HandleReader, you can
use hPutStr on the write Handle to send data to xmobar from your
application code.
Diffstat (limited to 'readme.md')
-rw-r--r-- | readme.md | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -1613,6 +1613,23 @@ will display "N/A" if for some reason the `date` invocation fails. logHook = dynamicLogString myPP >>= xmonadPropLog } +### `HandleReader Handle Alias` + +- Display data from a Haskell `Handle` +- This plugin is only useful if you are running xmobar from another Haskell + program like XMonad. +- You can use `System.Process.createPipe` to create a pair of `read` & `write` + Handles. Pass the `read` Handle to HandleReader and write your output to the + `write` Handle: + + (readHandle, writeHandle) <- createPipe + xmobarProcess <- forkProcess $ xmobar myConfig + { commands = + Run (HandleReader readHandle "handle") : commands myConfig + } + hPutStr writeHandle "Hello World" + + # Plugins ## Writing a Plugin |