xmonad-dbus

[ bsd3, library, program, unclassified ] [ Propose Tags ]

Please see the README on Github at https://github.com/githubuser/xmonad-dbus#readme


[Skip to Readme]
Versions [faq] 0.1.0.0
Dependencies base (>=4.7 && <5), dbus (>=0.10), utf8-string (>=1.0), xmonad-dbus [details]
License BSD-3-Clause
Copyright 2018 Dmitry Geurkov
Author Dmitry Geurkov
Maintainer d.geurkov@gmail.com
Home page https://github.com/troydm/xmonad-dbus#readme
Bug tracker https://github.com/troydm/xmonad-dbus/issues
Source repo head: git clone https://github.com/troydm/xmonad-dbus
Uploaded by troydm at 2020-10-12T14:16:48Z
Distributions NixOS:0.1.0.0
Executables xmonad-dbus
Downloads 52 total (7 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2020-10-12 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for xmonad-dbus-0.1.0.0

[back to package description]

xmonad-dbus

xmonad-dbus is DBus monitoring solution inspired by xmonad-log completely written in Haskell. It allows you to easily send your status via DBus using XMonad's DynamicLog to any application that can execute custom scripts. It can be used to easily display XMonad status in polybar

Building

stack build

Running

    # start xmonad-dbus, you can optionally specify a path that would be used when receiveing messages, 
    # otherwise all xmonad-dbus related messages will be received)
    stack exec xmonad-dbus -- [path]
    # you can manually send messages from command line too
    stack exec xmonad-dbus -- send string
    # and if you want to send messages only to particular path you can use sendToPath 
    stack exec xmonad-dbus -- sendToPath path string

Configuring XMonad

To send status information from XMonad you need to add xmonad-dbus as dependency either via stack or manually when building your xmonad.hs

    import XMonad
    import XMonad.Hooks.DynamicLog
    import qualified XMonad.DBus as D

    -- Override the PP values as you would like (see XMonad.Hooks.DynamicLog documentation)
    myLogHook :: D.Client -> PP
    myLogHook dbus = def { ppOutput = D.send dbus }

    main :: IO ()
    main = do
        -- Connect to DBus
        dbus <- D.connect
        -- Request access (needed when sending messages)
        D.requestAccess dbus
        -- start xmonad
        xmonad $ def { logHook = dynamicLogWithPP (myLogHook dbus) }

Configuring polybar

To receive status you need to add custom/script module to your polybar config Don't forget to add compiled xmonad-dbus executable to your PATH

[module/xmonad]
type = custom/script
exec = xmonad-dbus
tail = true
interval = 1