summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /x11-misc/xmonad-log-applet
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'x11-misc/xmonad-log-applet')
-rw-r--r--x11-misc/xmonad-log-applet/Manifest1
-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-r301.ebuild46
4 files changed, 125 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..25cc13b44be5
--- /dev/null
+++ b/x11-misc/xmonad-log-applet/Manifest
@@ -0,0 +1 @@
+DIST xmonad-log-applet-2.0.0.tar.gz 82881 SHA256 154bdb5b857195b318837ef086ddd3091d100884ada29a146ff18a5589549fa0 SHA512 1885ac97569d909ab1c6af99d9b271d0f782de905dfe035df27524f428d09cefa20a468103477132656dea8945faf886270fd70a49e5a08be538e04f3f05baca WHIRLPOOL 87bce2156b8a5f7a2c3b8b0597d24eee5238333e6a10c161a49e3cab08f3e1cdd3facfbf60ab879109b151143823e99d2d2c3470904e361fe892f950902e7d9f
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..1e501a4b3854
--- /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@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..89b75cd759d5
--- /dev/null
+++ b/x11-misc/xmonad-log-applet/xmonad-log-applet-2.0.0-r301.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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=""
+
+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
+}
+
+src_configure() {
+ econf --sysconfdir=/etc --with-panel=xfce4
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS.md README.md
+ dodoc "${FILESDIR}"/xmonad.hs
+}
+
+pkg_postinst() {
+ elog "Remember to update your xmonad.hs accordingly"
+ elog "a sample xmonad.hs is provided in /usr/share/doc/${PF}"
+}