diff options
Diffstat (limited to 'wmname')
| -rw-r--r-- | wmname/LICENSE | 21 | ||||
| -rw-r--r-- | wmname/Makefile | 51 | ||||
| -rw-r--r-- | wmname/README | 25 | ||||
| -rw-r--r-- | wmname/config.mk | 23 | ||||
| -rw-r--r-- | wmname/wmname.c | 53 |
5 files changed, 0 insertions, 173 deletions
diff --git a/wmname/LICENSE b/wmname/LICENSE deleted file mode 100644 index bf73bff..0000000 --- a/wmname/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT/X Consortium License - -© 2008 Anselm R Garbe <garbeam at gmail dot com> - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/wmname/Makefile b/wmname/Makefile deleted file mode 100644 index 61e7027..0000000 --- a/wmname/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -# wmname - prints/sets the WM name - -include config.mk -include ../config.mk - -SRC = wmname.c -OBJ = ${SRC:.c=.o} - -all: options wmname - -options: - @echo wmname build options: - @echo "CFLAGS = ${CFLAGS}" - @echo "LDFLAGS = ${LDFLAGS}" - @echo "CC = ${CC}" - @echo "LD = ${LD}" - -.c.o: - @echo CC $< - @${CC} -c ${CFLAGS} $< - -${OBJ}: config.mk - -wmname: ${OBJ} - @echo LD $@ - @${LD} -o $@ ${OBJ} ${LDFLAGS} - @strip $@ - -clean: - @echo cleaning - @rm -f wmname ${OBJ} wmname-${VERSION}.tar.gz - -dist: clean - @echo creating dist tarball - @mkdir -p wmname-${VERSION} - @cp -R LICENSE Makefile README config.mk ${SRC} wmname-${VERSION} - @tar -cf wmname-${VERSION}.tar wmname-${VERSION} - @gzip wmname-${VERSION}.tar - @rm -rf wmname-${VERSION} - -install: all - @echo installing executable file to ${DESTDIR}${PREFIX}/bin - @mkdir -p ${DESTDIR}${PREFIX}/bin - @cp -f wmname ${DESTDIR}${PREFIX}/bin - @chmod 755 ${DESTDIR}${PREFIX}/bin/wmname - -uninstall: - @echo removing executable file from ${DESTDIR}${PREFIX}/bin - @rm -f ${DESTDIR}${PREFIX}/bin/wmname - -.PHONY: all options clean dist install uninstall diff --git a/wmname/README b/wmname/README deleted file mode 100644 index a7d4b2c..0000000 --- a/wmname/README +++ /dev/null @@ -1,25 +0,0 @@ -wmname - prints/sets the WM name -================================ -Prints/sets the EWMH WM name property. - - -Requirements ------------- -In order to build wmname you need the Xlib header files. - - -Installation ------------- -Edit config.mk to match your local setup (wmname is installed into -the /usr/local namespace by default). - -Afterwards enter the following command to build and install wmname -(if necessary as root): - - make clean install - - -Running wmname --------------- -Run 'wmname' to print the current WM name. Run 'wmname <name>' to set it. This -is pretty much similiar to hostname(1). diff --git a/wmname/config.mk b/wmname/config.mk deleted file mode 100644 index 6b58a5c..0000000 --- a/wmname/config.mk +++ /dev/null @@ -1,23 +0,0 @@ -include ../config.mk -# wmname version -VERSION = 0.1 - -# Customize below to fit your system - -MANPREFIX = ${PREFIX}/share/man - -X11INC = /usr/X11R6/include -X11LIB = /usr/X11R6/lib - -# includes and libs -INCS = -I. -I/usr/include -I${X11INC} -LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 - -# flags -CPPFLAGS = -DVERSION=\"${VERSION}\" -CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS} -LDFLAGS = -s ${LIBS} - -# compiler and linker -CC = cc -LD = ${CC} diff --git a/wmname/wmname.c b/wmname/wmname.c deleted file mode 100644 index 7d846f3..0000000 --- a/wmname/wmname.c +++ /dev/null @@ -1,53 +0,0 @@ -/* See LICENSE file for details. */ -#include <stdarg.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <X11/Xlib.h> -#include <X11/Xatom.h> -#include <X11/Xutil.h> - -void -eprint(const char *errstr, ...) { - va_list ap; - - va_start(ap, errstr); - vfprintf(stderr, errstr, ap); - va_end(ap); - exit(EXIT_FAILURE); -} - -int -main(int argc, char **argv) { - int status, format; - unsigned char *data = NULL; - unsigned long n, extra; - Display *dpy; - Window root; - Atom netwmcheck, netwmname, utf8_string, real; - - if(argc > 2) - eprint("usage: wmname [name] [-v]\n"); - else if(argc == 2 && !strncmp(argv[1], "-v", 3)) - eprint("wmname-"VERSION", © 2008 Anselm R Garbe\n", stdout); - - if(!(dpy = XOpenDisplay(0))) - eprint("wmname: cannot open display\n"); - root = DefaultRootWindow(dpy); - netwmcheck = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); - netwmname = XInternAtom(dpy, "_NET_WM_NAME", False); - utf8_string = XInternAtom(dpy, "UTF8_STRING", False); - if(argc == 1) { - status = XGetWindowProperty(dpy, root, netwmname, 0L, 32L, False, utf8_string, &real, &format, &n, &extra, (unsigned char **) &data); - if(status == Success && data != NULL) - fprintf(stdout, "%s\n", data); - XFree(data); - } - else { - XChangeProperty(dpy, root, netwmcheck, XA_WINDOW, 32, PropModeReplace, (unsigned char *)&root, 1); - XChangeProperty(dpy, root, netwmname, utf8_string, 8, PropModeReplace, (unsigned char *)argv[1], strlen(argv[1])); - } - XSync(dpy, False); - XCloseDisplay(dpy); - return 0; -} |