summaryrefslogtreecommitdiff
path: root/x11-misc/xmonad-log-applet
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /x11-misc/xmonad-log-applet
reinit the tree, so we can have metadata
Diffstat (limited to 'x11-misc/xmonad-log-applet')
-rw-r--r--x11-misc/xmonad-log-applet/Manifest6
-rw-r--r--x11-misc/xmonad-log-applet/files/xmonad.hs60
-rw-r--r--x11-misc/xmonad-log-applet/metadata.xml17
-rw-r--r--x11-misc/xmonad-log-applet/xmonad-log-applet-2.0.0-r301.ebuild46
4 files changed, 129 insertions, 0 deletions
diff --git a/x11-misc/xmonad-log-applet/Manifest b/x11-misc/xmonad-log-applet/Manifest
new file mode 100644
index 000000000000..1b09663abb4b
--- /dev/null
+++ b/x11-misc/xmonad-log-applet/Manifest
@@ -0,0 +1,6 @@
+AUX xmonad.hs 1801 SHA256 c41e925429aaa0ca4a8c9c7013531e76008e37f998a33e5b213964cac2a7c6e0 SHA512 3d20f037dabff24c69811672850734396a4c4f57a9e33e03a15f93d8e5b4edcf43dadf9d95ab82c310dbf0064e8fb7a6a0e8e330c5b51997e0dffe719dd0cb21 WHIRLPOOL cd6bff95ffe7de5b9833e223d881720f87cdaf9deb0b38907d80be774b8cabbe909d22764fc316743aae569b4c507570df6567545db1f563599e0b8820be2133
+DIST xmonad-log-applet-2.0.0.tar.gz 82881 SHA256 154bdb5b857195b318837ef086ddd3091d100884ada29a146ff18a5589549fa0 SHA512 1885ac97569d909ab1c6af99d9b271d0f782de905dfe035df27524f428d09cefa20a468103477132656dea8945faf886270fd70a49e5a08be538e04f3f05baca WHIRLPOOL 87bce2156b8a5f7a2c3b8b0597d24eee5238333e6a10c161a49e3cab08f3e1cdd3facfbf60ab879109b151143823e99d2d2c3470904e361fe892f950902e7d9f
+EBUILD xmonad-log-applet-2.0.0-r301.ebuild 896 SHA256 cd48f921d90e0f8bebb75f682066bd4ec966440370b4f4b426813b62d9ff4ccf SHA512 f3cc04eeaaa647a64addef0be1d4786b2cd4c04ffd569e209bbca1014a836083641bade34280e242811bb901f17e006aca9a25bb2160bb43fe301c98660b34dd WHIRLPOOL 10dcee58e11e73d362ac28930b2bf39578d416daef57fe9847bf933c9b4e879ff4c7a7ef58457365d27f0edf38fd8717e1936fddb314b8edf14200a99b49cff7
+MISC ChangeLog 2622 SHA256 5931672f2e17c9bb282d7a624a459831155a37861f9d424bd8f2974e3616e518 SHA512 614bedb2c873f2256af5ea8d9c59901ebaf1e589c60575d4f4e851a6ab824418e27bb3de9b24f6d7555b616b2b2cc39e99da3cfad37067355c20c23ef3f537ee WHIRLPOOL 06085f38ee23f77e63fcaecf2ecd416ad0cc70fbef38babcb9d90c95df41126e3d5cf0b82bfc54a31c3f91f61a112a34e9ee53e381998b855f90fdbac29fb035
+MISC ChangeLog-2015 1394 SHA256 7fbbcbd6c871595d6aaafa6752df868054af0449fdb35acc8b88117d2bb141ad SHA512 a7270c3e289087bac23342e3ee00d3fe5ccdcfae0b220efc32fae772fc8cb4f85c0eb6563eea57200392bc68a15203ef6b1a48dc6ecf4c2dd91424b1769f4813 WHIRLPOOL 7a28387c3d24416d4b32c8c2a3f725b31b2b16c6c9b250bfed03706ca7c9772ccd50d2393c73663ca54a737220fdc117921d0441435ed33f5603845434df5b5f
+MISC metadata.xml 716 SHA256 56b9d9628292f9d553cd0b1950f3998d9d218dac11cf15f4058ba27f9216e7eb SHA512 96c994e5f75ee8af7c4695e67fc8997bc7a23b39969a0b733011b8c03edee444fd3cafb1eb47bf440aea4135f03a322ff8999eaacaf26891b3c7b8ec4af05229 WHIRLPOOL 4c54195503cb6ff88a3afe2f4a1d229dca26cf4827158b6a1ece9d3aad6e8a4248dbc3c07a438fd1b1ee405c1e28bfc1b6fca9b927f302f35b15085381ab76ae
diff --git a/x11-misc/xmonad-log-applet/files/xmonad.hs b/x11-misc/xmonad-log-applet/files/xmonad.hs
new file mode 100644
index 000000000000..54b0025a97c4
--- /dev/null
+++ b/x11-misc/xmonad-log-applet/files/xmonad.hs
@@ -0,0 +1,60 @@
+import XMonad
+import XMonad.Config.Gnome
+import XMonad.Hooks.DynamicLog
+
+import Control.OldException
+
+import DBus
+import DBus.Connection
+import DBus.Message
+
+main :: IO ()
+main = withConnection Session $ \dbus -> do
+ getWellKnownName dbus
+ xmonad $ gnomeConfig
+ { logHook = dynamicLogWithPP (prettyPrinter dbus)
+ }
+
+prettyPrinter :: Connection -> PP
+prettyPrinter dbus = defaultPP
+ { ppOutput = dbusOutput dbus
+ , ppTitle = pangoSanitize
+ , ppCurrent = pangoColor "green" . wrap "[" "]" . pangoSanitize
+ , ppVisible = pangoColor "yellow" . wrap "(" ")" . pangoSanitize
+ , ppHidden = const ""
+ , ppUrgent = pangoColor "red"
+ , ppLayout = const ""
+ , ppSep = " "
+ }
+
+getWellKnownName :: Connection -> IO ()
+getWellKnownName dbus = tryGetName `catchDyn` (\(DBus.Error _ _) -> getWellKnownName dbus)
+ where
+ tryGetName = do
+ namereq <- newMethodCall serviceDBus pathDBus interfaceDBus "RequestName"
+ addArgs namereq [String "org.xmonad.Log", Word32 5]
+ sendWithReplyAndBlock dbus namereq 0
+ return ()
+
+dbusOutput :: Connection -> String -> IO ()
+dbusOutput dbus str = do
+ msg <- newSignal "/org/xmonad/Log" "org.xmonad.Log" "Update"
+ addArgs msg [String ("<b>" ++ str ++ "</b>")]
+ -- If the send fails, ignore it.
+ send dbus msg 0 `catchDyn` (\(DBus.Error _ _) -> return 0)
+ return ()
+
+pangoColor :: String -> String -> String
+pangoColor fg = wrap left right
+ where
+ left = "<span foreground=\"" ++ fg ++ "\">"
+ right = "</span>"
+
+pangoSanitize :: String -> String
+pangoSanitize = foldr sanitize ""
+ where
+ sanitize '>' xs = "&gt;" ++ xs
+ sanitize '<' xs = "&lt;" ++ xs
+ sanitize '\"' xs = "&quot;" ++ xs
+ sanitize '&' xs = "&amp;" ++ xs
+ sanitize x xs = x:xs
diff --git a/x11-misc/xmonad-log-applet/metadata.xml b/x11-misc/xmonad-log-applet/metadata.xml
new file mode 100644
index 000000000000..d916bff47cc2
--- /dev/null
+++ b/x11-misc/xmonad-log-applet/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>haskell@gentoo.org</email>
+ </maintainer>
+ <maintainer type="person">
+ <email>flo@geekplace.eu</email>
+ <description>Maintainer, CC him on bugs</description>
+ </maintainer>
+ <longdescription>
+ xmonad-log-applet is for Xmonad users who find the GNOME, MATE, or Xfce panel useful. The applet will show the active workspaces, the title of the selected window or whatever information you send it from your xmonad.hs.
+</longdescription>
+ <upstream>
+ <remote-id type="github">alexkay/xmonad-log-applet</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/x11-misc/xmonad-log-applet/xmonad-log-applet-2.0.0-r301.ebuild b/x11-misc/xmonad-log-applet/xmonad-log-applet-2.0.0-r301.ebuild
new file mode 100644
index 000000000000..f0c5379f92e9
--- /dev/null
+++ b/x11-misc/xmonad-log-applet/xmonad-log-applet-2.0.0-r301.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit autotools gnome2
+
+DESCRIPTION="Gnome and XFCE applet for displaying XMonad log"
+HOMEPAGE="https://github.com/alexkay/xmonad-log-applet"
+SRC_URI="mirror://github/alexkay/${PN}/${P}.tar.gz"
+LICENSE="BSD"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RESTRICT="mirror"
+
+RDEPEND="
+ sys-apps/dbus
+ xfce-base/xfce4-panel
+ dev-libs/glib:2
+ dev-haskell/dbus
+ x11-libs/gtk+:3
+"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ eautoreconf
+ gnome2_src_prepare
+}
+
+src_configure() {
+ gnome2_src_configure --sysconfdir=/etc --with-panel=xfce4
+}
+
+src_install() {
+ gnome2_src_install
+ dodoc AUTHORS.md README.md
+ dodoc "${FILESDIR}"/xmonad.hs
+}
+
+pkg_postinst() {
+ gnome2_pkg_postinst
+ elog "Remember to update your xmonad.hs accordingly"
+ elog "a sample xmonad.hs is provided in /usr/share/doc/${PF}"
+}