diff --git a/x11/Makefile b/x11/Makefile index aa6405480270..22c89f0c3801 100644 --- a/x11/Makefile +++ b/x11/Makefile @@ -640,6 +640,7 @@ SUBDIR += xscreensaver.app SUBDIR += xsel-conrad SUBDIR += xset + SUBDIR += xseticon SUBDIR += xsetroot SUBDIR += xsettingsd SUBDIR += xskyroot diff --git a/x11/xseticon/Makefile b/x11/xseticon/Makefile new file mode 100644 index 000000000000..459b2d5fdf2e --- /dev/null +++ b/x11/xseticon/Makefile @@ -0,0 +1,27 @@ +PORTNAME= xseticon +PORTVERSION= 0.1 +DISTVERSIONSUFFIX= +bzr14 +CATEGORIES= x11 +MASTER_SITES= ${WWW} + +MAINTAINER= danfe@FreeBSD.org +COMMENT= Set window icon for any given X11 window +WWW= http://www.leonerd.org.uk/code/xseticon/ + +LICENSE= GPLv2+ + +LIB_DEPENDS= libgd.so:graphics/gd + +USES= gmake gnome pkgconfig xorg +USE_GNOME= glib20 +USE_XORG= x11 xmu + +PLIST_FILES= bin/${PORTNAME} + +post-patch: + @${REINPLACE_CMD} -e 's,gcc,$${CC} $${CFLAGS},' ${WRKSRC}/Makefile + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin + +.include diff --git a/x11/xseticon/distinfo b/x11/xseticon/distinfo new file mode 100644 index 000000000000..cf1bd256701b --- /dev/null +++ b/x11/xseticon/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1516047601 +SHA256 (xseticon-0.1+bzr14.tar.gz) = 048a8339b47030ebbff9cce4b58cb071a5c5f5a2cd7ff1ecc8434f95b2f8e4c5 +SIZE (xseticon-0.1+bzr14.tar.gz) = 10192 diff --git a/x11/xseticon/files/patch-xseticon.c b/x11/xseticon/files/patch-xseticon.c new file mode 100644 index 000000000000..6ab257f54a1b --- /dev/null +++ b/x11/xseticon/files/patch-xseticon.c @@ -0,0 +1,58 @@ +--- xseticon.c.orig 2018-01-15 20:20:01 UTC ++++ xseticon.c +@@ -46,6 +46,7 @@ void usage(int exitcode) + printf("options:\n"); + printf(" -name : apply icon to the window of the name supplied\n"); + printf(" -id : apply icon to the window id supplied\n"); ++ printf(" -class : apply icon to the window matching the class supplied\n"); + printf("\n"); + printf("Sets the window icon to the specified .png image. The image is loaded from\n"); + printf("the file at runtime and sent to the X server; thereafter the file does not\n"); +@@ -98,6 +99,30 @@ Window Window_With_Name(Display* dpy, Window top, char + return(w); + } + ++Window Window_With_Class(Display* dpy, Window top, char* class) ++{ ++ Window *children, dummy; ++ unsigned int nchildren; ++ int i; ++ Window w = 0; ++ XClassHint *hint = XAllocClassHint(); ++ ++ if (XGetClassHint(dpy, top, hint) ++ && (!strcmp(hint->res_class, class) || !strcmp(hint->res_name, class))) ++ return(top); ++ ++ if (!XQueryTree(dpy, top, &dummy, &dummy, &children, &nchildren)) ++ return(0); ++ ++ for (i=0; i