Sat Oct 8 10:06:52 2022 UTC ()
New package for xidle. From pkgsrc-wip.
xidle uses the XScreenSaver(3) extension to receive inactivity events
when a timeout is specified, running a specific program after the
elapsed time.
xidle also monitors the very corner of the given position for pointer
activity and runs a program if the pointer sits there for more than the
specified number of seconds.
(bsiegert)
diff -r1.964 -r1.965 pkgsrc/x11/Makefile
diff -r0 -r1.1 pkgsrc/x11/xidle/DESCR
diff -r0 -r1.1 pkgsrc/x11/xidle/MESSAGE
diff -r0 -r1.1 pkgsrc/x11/xidle/Makefile
diff -r0 -r1.1 pkgsrc/x11/xidle/PLIST
diff -r0 -r1.1 pkgsrc/x11/xidle/distinfo
diff -r0 -r1.1 pkgsrc/x11/xidle/patches/patch-Makefile
diff -r0 -r1.1 pkgsrc/x11/xidle/patches/patch-xidle.1
diff -r0 -r1.1 pkgsrc/x11/xidle/patches/patch-xidle.c
--- pkgsrc/x11/Makefile 2022/09/24 07:01:26 1.964
+++ pkgsrc/x11/Makefile 2022/10/08 10:06:51 1.965
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: Makefile,v 1.964 2022/09/24 07:01:26 wiz Exp $ | | 1 | # $NetBSD: Makefile,v 1.965 2022/10/08 10:06:51 bsiegert Exp $ |
2 | # | | 2 | # |
3 | | | 3 | |
4 | COMMENT= Packages to support the X Window System | | 4 | COMMENT= Packages to support the X Window System |
5 | | | 5 | |
6 | SUBDIR+= XaoS | | 6 | SUBDIR+= XaoS |
7 | SUBDIR+= Xaw-Xpm | | 7 | SUBDIR+= Xaw-Xpm |
8 | SUBDIR+= Xbae | | 8 | SUBDIR+= Xbae |
9 | SUBDIR+= XmHTML | | 9 | SUBDIR+= XmHTML |
10 | SUBDIR+= alacritty | | 10 | SUBDIR+= alacritty |
11 | SUBDIR+= antiright | | 11 | SUBDIR+= antiright |
12 | SUBDIR+= appmenu-qt | | 12 | SUBDIR+= appmenu-qt |
13 | SUBDIR+= appres | | 13 | SUBDIR+= appres |
14 | SUBDIR+= arandr | | 14 | SUBDIR+= arandr |
| @@ -601,26 +601,27 @@ SUBDIR+= xfce4-whiskermenu-plugin | | | @@ -601,26 +601,27 @@ SUBDIR+= xfce4-whiskermenu-plugin |
601 | SUBDIR+= xfd | | 601 | SUBDIR+= xfd |
602 | SUBDIR+= xfishtank | | 602 | SUBDIR+= xfishtank |
603 | SUBDIR+= xflame | | 603 | SUBDIR+= xflame |
604 | SUBDIR+= xfontsel | | 604 | SUBDIR+= xfontsel |
605 | SUBDIR+= xforms | | 605 | SUBDIR+= xforms |
606 | SUBDIR+= xfsinfo | | 606 | SUBDIR+= xfsinfo |
607 | SUBDIR+= xfstt | | 607 | SUBDIR+= xfstt |
608 | SUBDIR+= xgamma | | 608 | SUBDIR+= xgamma |
609 | SUBDIR+= xgas | | 609 | SUBDIR+= xgas |
610 | SUBDIR+= xgrk | | 610 | SUBDIR+= xgrk |
611 | SUBDIR+= xhangglider | | 611 | SUBDIR+= xhangglider |
612 | SUBDIR+= xhost | | 612 | SUBDIR+= xhost |
613 | SUBDIR+= xicc | | 613 | SUBDIR+= xicc |
| | | 614 | SUBDIR+= xidle |
614 | SUBDIR+= xinit | | 615 | SUBDIR+= xinit |
615 | SUBDIR+= xinput | | 616 | SUBDIR+= xinput |
616 | SUBDIR+= xisxwayland | | 617 | SUBDIR+= xisxwayland |
617 | SUBDIR+= xjman | | 618 | SUBDIR+= xjman |
618 | SUBDIR+= xkbcomp | | 619 | SUBDIR+= xkbcomp |
619 | SUBDIR+= xkbd | | 620 | SUBDIR+= xkbd |
620 | SUBDIR+= xkbdata | | 621 | SUBDIR+= xkbdata |
621 | SUBDIR+= xkbevd | | 622 | SUBDIR+= xkbevd |
622 | SUBDIR+= xkbprint | | 623 | SUBDIR+= xkbprint |
623 | SUBDIR+= xkbset | | 624 | SUBDIR+= xkbset |
624 | SUBDIR+= xkbutils | | 625 | SUBDIR+= xkbutils |
625 | SUBDIR+= xkeyboard-config | | 626 | SUBDIR+= xkeyboard-config |
626 | SUBDIR+= xkeycaps | | 627 | SUBDIR+= xkeycaps |
xidle uses the XScreenSaver(3) extension to receive inactivity events
when a timeout is specified, running a specific program after the
elapsed time.
xidle also monitors the very corner of the given position for pointer
activity and runs a program if the pointer sits there for more than the
specified number of seconds.
===========================================================================
$NetBSD: MESSAGE,v 1.1 2022/10/08 10:06:51 bsiegert Exp $
Unless told otherwise, xidle will attempt to start xlock(1) as default
screen locker.
Install x11/xlockmore if you wish for this behaviour to take effect.
===========================================================================
# $NetBSD: Makefile,v 1.1 2022/10/08 10:06:51 bsiegert Exp $
DISTNAME= xidle-20220718
CATEGORIES= x11
MASTER_SITES= https://sehnsucht.multics.org/pub/pkgsrc/distfiles/
DIST_SUBDIR= ${PKGNAME_NOREV}
EXTRACT_SUFX= .tar.xz
MAINTAINER= vms@retrobsd.ddns.net
HOMEPAGE= https://man.openbsd.org/xidle.1
COMMENT= Run a program on X inactivity
LICENSE= isc
MAKEFLAGS+= X11BASE=${X11BASE}
MAKEFLAGS+= MANDIR=${PKGMANDIR}
MAKEFLAGS+= CFLAGS=${CFLAGS:Q}
SUBST_CLASSES+= paths
SUBST_STAGE.paths= pre-configure
SUBST_FILES.paths+= xidle.c
SUBST_FILES.paths+= xidle.1
SUBST_VARS.paths= PREFIX
SUBST_MESSAGE.paths= Setting default locker's path.
INSTALLATION_DIRS= bin ${PKGMANDIR}/man1
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/xidle ${DESTDIR}${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/xidle.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "Linux" # strtonum()
LDFLAGS+= -lbsd
.include "../../devel/libbsd/buildlink3.mk"
.endif
.include "../../x11/libXdmcp/buildlink3.mk"
.include "../../x11/libXScrnSaver/buildlink3.mk"
.include "../../x11/libXau/buildlink3.mk"
.include "../../x11/libXext/buildlink3.mk"
.include "../../x11/libX11/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
@comment $NetBSD: PLIST,v 1.1 2022/10/08 10:06:51 bsiegert Exp $
bin/xidle
man/man1/xidle.1
$NetBSD: distinfo,v 1.1 2022/10/08 10:06:51 bsiegert Exp $
BLAKE2s (xidle-20220718/xidle-20220718.tar.xz) = fb40e18d9bfe7b8379b57390e79e35a7df2f06223632f8c71da4c20244eaff92
SHA512 (xidle-20220718/xidle-20220718.tar.xz) = f72fdc91a2c9173ca26291d46ed3857624a1be7c44918bf7e985f0dae184eb8c0201c4e0fb0cda5f33e6f488835f7a68e888aebc180c1eca3c4396a67e659c86
Size (xidle-20220718/xidle-20220718.tar.xz) = 5640 bytes
SHA1 (patch-Makefile) = f93b2ffc31da13d143dd157d670e299f0568713a
SHA1 (patch-xidle.1) = dcb4906dd1ca4780925ffd96193afd3cdb3b6401
SHA1 (patch-xidle.c) = 02058baddefbad2ba42784eba6fce980a1020314
$NetBSD: patch-Makefile,v 1.1 2022/10/08 10:06:52 bsiegert Exp $
Portability fixes for pkgsrc.
--- Makefile.orig 2015-05-26 05:22:15.000000000 +0000
+++ Makefile
@@ -1,6 +1,3 @@
-# $OpenBSD: Makefile,v 1.7 2011/06/23 22:48:59 naddy Exp $
-.include <bsd.xconf.mk>
-
PROG= xidle
CPPFLAGS+= -I${X11BASE}/include
@@ -9,7 +6,4 @@ LDADD+= -L${X11BASE}/lib -lXss -lXext -l
MANDIR= ${X11BASE}/man/man
-obj: _xenocara_obj
-
.include <bsd.prog.mk>
-.include <bsd.xorg.mk>
$NetBSD: patch-xidle.1,v 1.1 2022/10/08 10:06:52 bsiegert Exp $
Do not hard-code xlock path.
--- xidle.1.orig 2015-05-26 05:22:15.000000000 +0000
+++ xidle.1
@@ -127,7 +127,7 @@ Run
using the flying bats mode if no activity is detected in 300 seconds or the
pointer sits in the southwest corner for more than 5 seconds:
.Bd -literal -offset indent
-$ xidle -delay 5 -sw -program "/usr/X11R6/bin/xlock -mode bat" \e
+$ xidle -delay 5 -sw -program "@PREFIX@/bin/xlock -mode bat" \e
-timeout 300
.Ed
.Sh SEE ALSO
$NetBSD: patch-xidle.c,v 1.1 2022/10/08 10:06:52 bsiegert Exp $
Portability fixes:
- Define non-standard compiler attribute extension.
- Do not hard-code xlock path.
- Disable pledge.
- Use libbsd on Linux.
--- xidle.c.orig 2022-07-18 06:17:31.000000000 +0000
+++ xidle.c
@@ -39,15 +39,21 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#ifdef __linux__
+#include <bsd/stdlib.h>
+#endif
#ifndef CLASS_NAME
#define CLASS_NAME "XIdle"
#endif
#ifndef PATH_PROG
-#define PATH_PROG "/usr/X11R6/bin/xlock"
+#define PATH_PROG "@PREFIX@/bin/xlock"
#endif
+#ifndef __dead
+#define __dead __attribute__((__noreturn__))
+#endif
enum {
north = 0x01,
@@ -354,9 +360,6 @@ main(int argc, char **argv)
if (fd > 2)
close(fd);
- if (pledge("stdio proc exec", NULL) == -1)
- err(1, "pledge");
-
for (;;) {
XEvent ev;
u_long mask;