Add dunst 1.1.0
This commit is contained in:
1
x11-misc/dunst/Manifest
Normal file
1
x11-misc/dunst/Manifest
Normal file
@@ -0,0 +1 @@
|
||||
DIST v1.1.0.tar.gz 83120 SHA256 1a075a0aee56aea5aa2007f156f97bd180b3c771b7751729612629a04f712575 SHA512 f0aeeddd8835a63b722134146ec2deb41cc836fbc9b08943cf817f5f26fec0d2dddf0883d62c04e17bd912fb823283ebdab27e490bad87bd6697e1fb6c7aed50 WHIRLPOOL a6c79689eb8a39ac9cecdb3ff16108f88ba8941cbde1fb8c5ca2a8f81337751c7681ed4a559a2ede0f7dd62abdac206ed3c3646e71c5c86389245a44a261ec2a
|
||||
64
x11-misc/dunst/dunst-1.1.0.ebuild
Normal file
64
x11-misc/dunst/dunst-1.1.0.ebuild
Normal file
@@ -0,0 +1,64 @@
|
||||
# Copyright 1999-2014 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/x11-misc/dunst/dunst-1.0.0-r1.ebuild,v 1.1 2014/05/08 05:59:22 wired Exp $
|
||||
|
||||
EAPI=5
|
||||
|
||||
inherit eutils
|
||||
|
||||
DESCRIPTION="customizable and lightweight notification-daemon"
|
||||
HOMEPAGE="http://www.knopwob.org/dunst/"
|
||||
#SRC_URI="http://www.knopwob.org/public/dunst-release/${P}.tar.bz2"
|
||||
SRC_URI="https://github.com/knopwob/dunst/archive/v${PVR}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="dunstify"
|
||||
|
||||
CDEPEND="
|
||||
dev-libs/glib:2
|
||||
dev-libs/libxdg-basedir
|
||||
sys-apps/dbus
|
||||
x11-libs/libXScrnSaver
|
||||
x11-libs/libXft
|
||||
x11-libs/libXinerama
|
||||
x11-libs/cairo[X,glib]
|
||||
x11-libs/pango[X]
|
||||
dunstify? ( x11-libs/libnotify )
|
||||
"
|
||||
|
||||
DEPEND="${CDEPEND}
|
||||
dev-lang/perl
|
||||
virtual/pkgconfig"
|
||||
|
||||
RDEPEND="${CDEPEND}"
|
||||
|
||||
src_prepare() {
|
||||
# fixes backported from git
|
||||
#epatch "${FILESDIR}"/${P}-correctly_handle_num_lock.patch
|
||||
#epatch "${FILESDIR}"/${P}-fix_pause_resume.patch
|
||||
|
||||
# Remove nasty CFLAGS which override user choice
|
||||
sed -ie "/^CFLAGS/ {
|
||||
s:-g::
|
||||
s:-O.::
|
||||
}" config.mk || die "sed failed"
|
||||
|
||||
if ! use dunstify; then
|
||||
# don't build dunstify: it pulls in deps but is not being installed
|
||||
sed -ie "/^all:/ s:dunstify::" Makefile || die "sed failed"
|
||||
fi
|
||||
|
||||
epatch_user
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake DESTDIR="${D}" PREFIX="/usr" install
|
||||
|
||||
if use dunstify; then
|
||||
dobin dunstify
|
||||
fi
|
||||
|
||||
dodoc CHANGELOG
|
||||
}
|
||||
149
x11-misc/dunst/files/dunst-1.0.0-correctly_handle_num_lock.patch
Normal file
149
x11-misc/dunst/files/dunst-1.0.0-correctly_handle_num_lock.patch
Normal file
@@ -0,0 +1,149 @@
|
||||
https://github.com/knopwob/dunst/commit/be7d2b351
|
||||
|
||||
From be7d2b3511dc528b135e5dc6d5358c700fefaa30 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= <necoro@necoro.net>
|
||||
Date: Mon, 3 Jun 2013 14:39:24 +0200
|
||||
Subject: [PATCH] Correctly handle Num_Lock.
|
||||
|
||||
Find out which modifier key is used by Num_Lock (`x_numlock_mod()`) and
|
||||
register grabs for both variants: modifier present/not present.
|
||||
---
|
||||
x.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------
|
||||
1 file changed, 67 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/x.c
|
||||
+++ b/x.c
|
||||
@@ -485,6 +485,58 @@ static void setopacity(Window win, unsigned long opacity)
|
||||
|
||||
|
||||
|
||||
+ /*
|
||||
+ * Returns the modifier which is NumLock.
|
||||
+ */
|
||||
+static KeySym x_numlock_mod()
|
||||
+{
|
||||
+ static KeyCode nl = 0;
|
||||
+ KeySym sym = 0;
|
||||
+ XModifierKeymap * map = XGetModifierMapping(xctx.dpy);
|
||||
+
|
||||
+ if (!nl)
|
||||
+ nl = XKeysymToKeycode(xctx.dpy, XStringToKeysym("Num_Lock"));
|
||||
+
|
||||
+ for (int mod = 0; mod < 8; mod++) {
|
||||
+ for (int j = 0; j < map->max_keypermod; j++) {
|
||||
+ if (map->modifiermap[mod*map->max_keypermod+j] == nl) {
|
||||
+ /* In theory, one could use `1 << mod`, but this
|
||||
+ * could count as 'using implementation details',
|
||||
+ * so use this large switch. */
|
||||
+ switch (mod) {
|
||||
+ case ShiftMapIndex:
|
||||
+ sym = ShiftMask;
|
||||
+ goto end;
|
||||
+ case LockMapIndex:
|
||||
+ sym = LockMask;
|
||||
+ goto end;
|
||||
+ case ControlMapIndex:
|
||||
+ sym = ControlMask;
|
||||
+ goto end;
|
||||
+ case Mod1MapIndex:
|
||||
+ sym = Mod1Mask;
|
||||
+ goto end;
|
||||
+ case Mod2MapIndex:
|
||||
+ sym = Mod2Mask;
|
||||
+ goto end;
|
||||
+ case Mod3MapIndex:
|
||||
+ sym = Mod3Mask;
|
||||
+ goto end;
|
||||
+ case Mod4MapIndex:
|
||||
+ sym = Mod4Mask;
|
||||
+ goto end;
|
||||
+ case Mod5MapIndex:
|
||||
+ sym = Mod5Mask;
|
||||
+ goto end;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+end:
|
||||
+ XFreeModifiermap(map);
|
||||
+ return sym;
|
||||
+}
|
||||
|
||||
/*
|
||||
* Helper function to use glib's mainloop mechanic
|
||||
@@ -515,6 +567,7 @@ gboolean x_mainloop_fd_dispatch(GSource * source, GSourceFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
XEvent ev;
|
||||
+ unsigned int state;
|
||||
while (XPending(xctx.dpy) > 0) {
|
||||
XNextEvent(xctx.dpy, &ev);
|
||||
switch (ev.type) {
|
||||
@@ -535,10 +588,13 @@ gboolean x_mainloop_fd_dispatch(GSource * source, GSourceFunc callback,
|
||||
}
|
||||
break;
|
||||
case KeyPress:
|
||||
+ state = ev.xkey.state;
|
||||
+ /* NumLock is also encoded in the state. Remove it. */
|
||||
+ state &= ~x_numlock_mod();
|
||||
if (settings.close_ks.str
|
||||
&& XLookupKeysym(&ev.xkey,
|
||||
0) == settings.close_ks.sym
|
||||
- && settings.close_ks.mask == ev.xkey.state) {
|
||||
+ && settings.close_ks.mask == state) {
|
||||
if (displayed) {
|
||||
notification *n = g_queue_peek_head(displayed);
|
||||
if (n)
|
||||
@@ -548,19 +604,19 @@ gboolean x_mainloop_fd_dispatch(GSource * source, GSourceFunc callback,
|
||||
if (settings.history_ks.str
|
||||
&& XLookupKeysym(&ev.xkey,
|
||||
0) == settings.history_ks.sym
|
||||
- && settings.history_ks.mask == ev.xkey.state) {
|
||||
+ && settings.history_ks.mask == state) {
|
||||
history_pop();
|
||||
}
|
||||
if (settings.close_all_ks.str
|
||||
&& XLookupKeysym(&ev.xkey,
|
||||
0) == settings.close_all_ks.sym
|
||||
- && settings.close_all_ks.mask == ev.xkey.state) {
|
||||
+ && settings.close_all_ks.mask == state) {
|
||||
move_all_to_history();
|
||||
}
|
||||
if (settings.context_ks.str
|
||||
&& XLookupKeysym(&ev.xkey,
|
||||
0) == settings.context_ks.sym
|
||||
- && settings.context_ks.mask == ev.xkey.state) {
|
||||
+ && settings.context_ks.mask == state) {
|
||||
context_menu();
|
||||
}
|
||||
break;
|
||||
@@ -953,9 +1009,12 @@ int x_shortcut_grab(keyboard_shortcut * ks)
|
||||
|
||||
x_shortcut_setup_error_handler();
|
||||
|
||||
- if (ks->is_valid)
|
||||
+ if (ks->is_valid) {
|
||||
XGrabKey(xctx.dpy, ks->code, ks->mask, root,
|
||||
true, GrabModeAsync, GrabModeAsync);
|
||||
+ XGrabKey(xctx.dpy, ks->code, ks->mask | x_numlock_mod() , root,
|
||||
+ true, GrabModeAsync, GrabModeAsync);
|
||||
+ }
|
||||
|
||||
if (x_shortcut_tear_down_error_handler()) {
|
||||
fprintf(stderr, "Unable to grab key \"%s\"\n", ks->str);
|
||||
@@ -972,8 +1031,10 @@ void x_shortcut_ungrab(keyboard_shortcut * ks)
|
||||
{
|
||||
Window root;
|
||||
root = RootWindow(xctx.dpy, DefaultScreen(xctx.dpy));
|
||||
- if (ks->is_valid)
|
||||
+ if (ks->is_valid) {
|
||||
XUngrabKey(xctx.dpy, ks->code, ks->mask, root);
|
||||
+ XUngrabKey(xctx.dpy, ks->code, ks->mask | x_numlock_mod(), root);
|
||||
+ }
|
||||
}
|
||||
|
||||
/*
|
||||
--
|
||||
1.9.1
|
||||
|
||||
60
x11-misc/dunst/files/dunst-1.0.0-fix_pause_resume.patch
Normal file
60
x11-misc/dunst/files/dunst-1.0.0-fix_pause_resume.patch
Normal file
@@ -0,0 +1,60 @@
|
||||
https://github.com/knopwob/dunst/commit/04248fd4
|
||||
|
||||
From 04248fd49ef6769c7dc7e246fc505ad9c70afe27 Mon Sep 17 00:00:00 2001
|
||||
From: Sascha Kruse <knopwob@googlemail.com>
|
||||
Date: Mon, 22 Apr 2013 20:07:35 +0000
|
||||
Subject: [PATCH] fix pause/resume
|
||||
|
||||
this fixes github issue #98
|
||||
---
|
||||
dunst.c | 14 ++++++++------
|
||||
1 file changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/dunst.c
|
||||
+++ b/dunst.c
|
||||
@@ -105,7 +105,7 @@ void update_lists()
|
||||
|
||||
if (pause_display) {
|
||||
while (displayed->length > 0) {
|
||||
- g_queue_insert_sorted(queue, g_queue_pop_head(queue),
|
||||
+ g_queue_insert_sorted(queue, g_queue_pop_head(displayed),
|
||||
notification_cmp_data, NULL);
|
||||
}
|
||||
return;
|
||||
@@ -240,16 +240,16 @@ gboolean run(void *data)
|
||||
timeout_cnt--;
|
||||
}
|
||||
|
||||
- if (displayed->length > 0 && !xctx.visible) {
|
||||
- x_win_show();
|
||||
+ if (displayed->length > 0 && !xctx.visible && !pause_display) {
|
||||
+ x_win_show();
|
||||
}
|
||||
|
||||
- if (displayed->length == 0 && xctx.visible) {
|
||||
- x_win_hide();
|
||||
+ if (xctx.visible && (pause_display || displayed->length == 0)) {
|
||||
+ x_win_hide();
|
||||
}
|
||||
|
||||
if (xctx.visible) {
|
||||
- x_win_draw();
|
||||
+ x_win_draw();
|
||||
}
|
||||
|
||||
if (xctx.visible) {
|
||||
@@ -355,9 +355,11 @@ void pause_signal_handler(int sig)
|
||||
{
|
||||
if (sig == SIGUSR1) {
|
||||
pause_display = true;
|
||||
+ wake_up();
|
||||
}
|
||||
if (sig == SIGUSR2) {
|
||||
pause_display = false;
|
||||
+ wake_up();
|
||||
}
|
||||
|
||||
signal(sig, pause_signal_handler);
|
||||
--
|
||||
1.9.1
|
||||
|
||||
11
x11-misc/dunst/metadata.xml
Normal file
11
x11-misc/dunst/metadata.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer>
|
||||
<email>wired@gentoo.org</email>
|
||||
<name>Alex Alexander</name>
|
||||
</maintainer>
|
||||
<use>
|
||||
<flag name="dunstify">Experimental replacement for notify-send.</flag>
|
||||
</use>
|
||||
</pkgmetadata>
|
||||
Reference in New Issue
Block a user