summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Vershilov <qnikst@gentoo.org>2013-06-07 20:00:08 +0000
committerAlexander Vershilov <qnikst@gentoo.org>2013-06-07 20:00:08 +0000
commit1ffebd7c88cf96a6f03719cd1df3d13e9b41d775 (patch)
tree4056c7d7f1f3c6ce1e3cafb3dcdc627900f2c0b7 /x11-misc
parentRevert upstream commit that discontinued support for --enable-static in order... (diff)
downloadgentoo-2-1ffebd7c88cf96a6f03719cd1df3d13e9b41d775.tar.gz
gentoo-2-1ffebd7c88cf96a6f03719cd1df3d13e9b41d775.tar.bz2
gentoo-2-1ffebd7c88cf96a6f03719cd1df3d13e9b41d775.zip
add xmonad-log-applet
(Portage version: 2.2.0_alpha177/cvs/Linux x86_64, signed Manifest commit with key 0xEAD50D64D8D3571A!)
Diffstat (limited to 'x11-misc')
-rw-r--r--x11-misc/xmonad-log-applet/ChangeLog11
-rw-r--r--x11-misc/xmonad-log-applet/files/xmonad.hs60
-rw-r--r--x11-misc/xmonad-log-applet/metadata.xml18
-rw-r--r--x11-misc/xmonad-log-applet/xmonad-log-applet-2.0.0-r200.ebuild53
-rw-r--r--x11-misc/xmonad-log-applet/xmonad-log-applet-2.0.0-r300.ebuild53
5 files changed, 195 insertions, 0 deletions
diff --git a/x11-misc/xmonad-log-applet/ChangeLog b/x11-misc/xmonad-log-applet/ChangeLog
new file mode 100644
index 000000000000..77b5ea703906
--- /dev/null
+++ b/x11-misc/xmonad-log-applet/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for x11-misc/xmonad-log-applet
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/x11-misc/xmonad-log-applet/ChangeLog,v 1.1 2013/06/07 20:00:08 qnikst Exp $
+
+*xmonad-log-applet-2.0.0-r200 (07 Jun 2013)
+*xmonad-log-applet-2.0.0-r300 (07 Jun 2013)
+
+ 07 Jun 2013; Alexander Vershilov <qnikst@gentoo.org> +files/xmonad.hs,
+ +metadata.xml, +xmonad-log-applet-2.0.0-r200.ebuild,
+ +xmonad-log-applet-2.0.0-r300.ebuild:
+ add xmonad-log-applet
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..a88db8139b3e
--- /dev/null
+++ b/x11-misc/xmonad-log-applet/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>haskell</herd>
+<maintainer>
+ <email>haskell@gentoo.org</email>
+</maintainer>
+<maintainer>
+ <email>flo@freakempire.de</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>
+<use>
+ <flag name="xfce4">add xfce4 pannel support</flag>
+</use>
+</pkgmetadata>
diff --git a/x11-misc/xmonad-log-applet/xmonad-log-applet-2.0.0-r200.ebuild b/x11-misc/xmonad-log-applet/xmonad-log-applet-2.0.0-r200.ebuild
new file mode 100644
index 000000000000..82b12a084a49
--- /dev/null
+++ b/x11-misc/xmonad-log-applet/xmonad-log-applet-2.0.0-r200.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-misc/xmonad-log-applet/xmonad-log-applet-2.0.0-r200.ebuild,v 1.1 2013/06/07 20:00:08 qnikst Exp $
+
+EAPI=5
+
+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="gnome xfce4"
+
+RESTRICT="mirror"
+
+RDEPEND="sys-apps/dbus
+ gnome? ( <gnome-base/gnome-panel-3.0 )
+ xfce4? ( xfce-base/xfce4-panel )
+ dev-libs/glib:2
+ dev-haskell/dbus
+ x11-libs/gtk+:2"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ myconf=""
+
+ use gnome && myconf="${myconf} --with-panel=gnome2"
+ use xfce4 && myconf="${myconf} --with-panel=xfce4"
+
+ econf --sysconfdir=/etc ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS.md README.md
+ dodoc "${FILESDIR}"/xmonad.hs
+}
+
+pkg_postinst() {
+ ghc-package_pkg_postinst
+
+ elog "Remember to update your xmonad.hs accordingly"
+ elog "a sample xmonad.hs is provided in /usr/share/doc/${PF}"
+}
diff --git a/x11-misc/xmonad-log-applet/xmonad-log-applet-2.0.0-r300.ebuild b/x11-misc/xmonad-log-applet/xmonad-log-applet-2.0.0-r300.ebuild
new file mode 100644
index 000000000000..a5d079a4ee6c
--- /dev/null
+++ b/x11-misc/xmonad-log-applet/xmonad-log-applet-2.0.0-r300.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-misc/xmonad-log-applet/xmonad-log-applet-2.0.0-r300.ebuild,v 1.1 2013/06/07 20:00:08 qnikst Exp $
+
+EAPI=4
+
+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="+gnome xfce4"
+
+RESTRICT="mirror"
+
+RDEPEND="sys-apps/dbus
+ gnome? ( >=gnome-base/gnome-panel-3.0.2 )
+ xfce4? ( xfce-base/xfce4-panel )
+ dev-libs/glib:2
+ dev-haskell/dbus
+ x11-libs/gtk+:3"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ myconf=""
+
+ use gnome && myconf="${myconf} --with-panel=gnome3"
+ use xfce4 && myconf="${myconf} --with-panel=xfce4"
+
+ econf --sysconfdir=/etc ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS.md README.md
+ dodoc "${FILESDIR}"/xmonad.hs
+}
+
+pkg_postinst() {
+ ghc-package_pkg_postinst
+
+ elog "Remember to update your xmonad.hs accordingly"
+ elog "a sample xmonad.hs is provided in /usr/share/doc/${PF}"
+}