Skip to content

Instantly share code, notes, and snippets.

@nekolinuxblog
Last active February 20, 2021 04:42
Show Gist options
  • Save nekolinuxblog/adfdcbb40ffa7ea211269406b6e1b143 to your computer and use it in GitHub Desktop.
Save nekolinuxblog/adfdcbb40ffa7ea211269406b6e1b143 to your computer and use it in GitHub Desktop.
-- xmonadに紐づけたdbusに出力するためのアクションのための関数定義
-- from https://github.com/xintron/xmonad-log
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"
-- デフォルトのlogHookの出力先等を上書き設定するためのPP
myPolybarPP :: D.Client -> PP
myPolybarPP dbus =
def { ppOutput = dbusOutput dbus
, ppCurrent = wrap "[" "]"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment