All Projects → xintron → xmonad-log

xintron / xmonad-log

Licence: MIT license
DBus monitor for xmonad log events.

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to xmonad-log

Polybar Themes
A huge collection of polybar themes with different styles, colors and variants.
Stars: ✭ 3,687 (+11793.55%)
Mutual labels:  statusbar, polybar
yags
Go powered statusline generator
Stars: ✭ 18 (-41.94%)
Mutual labels:  statusbar, dbus
polybar-bluetooth
A fully functional bluetooth module for polybar
Stars: ✭ 59 (+90.32%)
Mutual labels:  polybar
myconfig
my Linux Configuration
Stars: ✭ 23 (-25.81%)
Mutual labels:  xmonad
bspwmbar
A lightweight status bar for bspwm.
Stars: ✭ 70 (+125.81%)
Mutual labels:  statusbar
dotfiles
A place to store config files so I can revert when my entire system crashes from entering the wrong character
Stars: ✭ 25 (-19.35%)
Mutual labels:  polybar
status-bar-height
Listen to status bar changes during incoming calls and other multi-tasking events
Stars: ✭ 73 (+135.48%)
Mutual labels:  statusbar
uniblocks
Status bar agnostic module generator
Stars: ✭ 40 (+29.03%)
Mutual labels:  polybar
kali-config
Linux colorful dotfiles.
Stars: ✭ 40 (+29.03%)
Mutual labels:  polybar
dasbus
DBus library in Python 3
Stars: ✭ 52 (+67.74%)
Mutual labels:  dbus
node-dbus-next
🚌 The next great dbus library for node
Stars: ✭ 141 (+354.84%)
Mutual labels:  dbus
polybar-gmail
A Polybar module to show unread messages from Gmail
Stars: ✭ 76 (+145.16%)
Mutual labels:  polybar
mpris-rs
Idiomatic MPRIS D-Bus interface library for Rust
Stars: ✭ 37 (+19.35%)
Mutual labels:  dbus
polypomo
Pomodoro widget for use with polybar (or standalone if you are so inclined)
Stars: ✭ 81 (+161.29%)
Mutual labels:  polybar
yet-another-spotify-lyrics
Command Line Spotify Lyrics with Album Cover
Stars: ✭ 78 (+151.61%)
Mutual labels:  dbus
dotfiles
Repository to manage and share personal dotfiles
Stars: ✭ 67 (+116.13%)
Mutual labels:  polybar
bluez-dbus
bluetooth library for linux OSes using DBus and bluez (http://www.bluez.org/).
Stars: ✭ 49 (+58.06%)
Mutual labels:  dbus
dotfiles
Dotfiles
Stars: ✭ 25 (-19.35%)
Mutual labels:  xmonad
i3wm-config
i3wm config files. Updated config files are in the repository below.
Stars: ✭ 13 (-58.06%)
Mutual labels:  polybar
rust-sysbar
Rust library for interacting with the system's taskbar / tray / statusbar
Stars: ✭ 55 (+77.42%)
Mutual labels:  statusbar

xmonad-log

xmonad-log is a DBus monitoring solution that can easily be used to display xmonad in a statusbar like polybar, lemonbar and similar.

Installation

xmonad-log is written in Go with one dependency: dbus. Binary packages are available.

Building from source

This package has been tested with Go 1.7 and above.

To build from source:

  1. Clone this repository into $GOPATH/src/github.com/xintron/xmonad-log.
  2. Build it within the directory with go build.

This should leave a xmonad-log binary in the directory. Move this to an appropriate directory in your $PATH.

Configure xmonad

To configure xmonad to send log events over DBus the haskell dbus package is required. Once installed the following can be added to your .xmonad/xmonad.hs configuration to add DBus support.

import XMonad
import XMonad.Hooks.DynamicLog

import qualified DBus as D
import qualified DBus.Client as D
import qualified Codec.Binary.UTF8.String as UTF8

main :: IO ()
main = do
    dbus <- D.connectSession
    -- Request access to the DBus name
    D.requestName dbus (D.busName_ "org.xmonad.Log")
        [D.nameAllowReplacement, D.nameReplaceExisting, D.nameDoNotQueue]

    xmonad $ def { logHook = dynamicLogWithPP (myLogHook dbus) }

-- Override the PP values as you would otherwise, adding colors etc depending
-- on  the statusbar used
myLogHook :: D.Client -> PP
myLogHook dbus = def { ppOutput = dbusOutput dbus }

-- Emit a DBus signal on log updates
dbusOutput :: D.Client -> String -> IO ()
dbusOutput dbus str = do
    let signal = (D.signal objectPath interfaceName memberName) {
            D.signalBody = [D.toVariant $ UTF8.decodeString str]
        }
    D.emit dbus signal
  where
    objectPath = D.objectPath_ "/org/xmonad/Log"
    interfaceName = D.interfaceName_ "org.xmonad.Log"
    memberName = D.memberName_ "Update"

View this xmonad-config for a fully working polybar example using statusbar coloring.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].