xmonad-dbus

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

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2
Dependencies base (>=4.7 && <5), dbus (>=0.10), xmonad-dbus [details]
License BSD-3-Clause
Copyright 2018-2023 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 2023-07-20T01:29:21Z
Distributions NixOS:0.1.0.2
Executables xmonad-dbus
Downloads 501 total (16 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-07-20 [all 1 reports]

Readme for xmonad-dbus-0.1.0.2

[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

Installation

With Stack

    stack build

With AUR

Use your favourite AUR helper to install on ArchLinux-based distribution:

    pikaur -S xmonad-dbus-git

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
    import qualified DBus.Client as DC

    -- Override the PP values as you would like (see XMonad.Hooks.DynamicLog documentation)
    myLogHook :: DC.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