MyNixOS website logo
Description

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

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

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
Metadata

Version

0.1.0.2

Executables (1)

  • bin/xmonad-dbus

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows