Remove sselp
parent
fe0a4a4f2f
commit
c7a6fc34ff
|
@ -1 +0,0 @@
|
|||
*.backup
|
|
@ -1,2 +0,0 @@
|
|||
effa85f232313bdd7855a83941d42e28ccaf8808 0.1
|
||||
5293716fdc7c4c31e2936ec52d684b403356e747 0.2
|
|
@ -1,21 +0,0 @@
|
|||
MIT/X Consortium License
|
||||
|
||||
© 2006-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.
|
|
@ -1,48 +0,0 @@
|
|||
# sselp - simple print selection
|
||||
|
||||
include config.mk
|
||||
|
||||
SRC = sselp.c
|
||||
OBJ = ${SRC:.c=.o}
|
||||
|
||||
all: options sselp
|
||||
|
||||
options:
|
||||
@echo sselp build options:
|
||||
@echo "CFLAGS = ${CFLAGS}"
|
||||
@echo "LDFLAGS = ${LDFLAGS}"
|
||||
@echo "CC = ${CC}"
|
||||
|
||||
.c.o:
|
||||
@echo CC $<
|
||||
@${CC} -c ${CFLAGS} $<
|
||||
|
||||
${OBJ}: config.mk
|
||||
|
||||
sselp: ${OBJ}
|
||||
@echo CC -o $@
|
||||
@${CC} -o $@ ${OBJ} ${LDFLAGS}
|
||||
|
||||
clean:
|
||||
@echo cleaning
|
||||
@rm -f sselp ${OBJ} sselp-${VERSION}.tar.gz
|
||||
|
||||
dist: clean
|
||||
@echo creating dist tarball
|
||||
@mkdir -p sselp-${VERSION}
|
||||
@cp -R LICENSE Makefile README config.mk ${SRC} sselp-${VERSION}
|
||||
@tar -cf sselp-${VERSION}.tar sselp-${VERSION}
|
||||
@gzip sselp-${VERSION}.tar
|
||||
@rm -rf sselp-${VERSION}
|
||||
|
||||
install: all
|
||||
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
|
||||
@mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
@cp -f sselp ${DESTDIR}${PREFIX}/bin
|
||||
@chmod 755 ${DESTDIR}${PREFIX}/bin/sselp
|
||||
|
||||
uninstall:
|
||||
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
|
||||
@rm -f ${DESTDIR}${PREFIX}/bin/sselp
|
||||
|
||||
.PHONY: all options clean dist install uninstall
|
|
@ -1,24 +0,0 @@
|
|||
sselp - simple print selection
|
||||
==============================
|
||||
Prints X selection to standard out.
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
In order to build sselp you need the Xlib header files.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
Edit config.mk to match your local setup (sselp is installed into
|
||||
the /usr/local namespace by default).
|
||||
|
||||
Afterwards enter the following command to build and install sselp
|
||||
(if necessary as root):
|
||||
|
||||
make clean install
|
||||
|
||||
|
||||
Running sselp
|
||||
-------------
|
||||
Simply invoke the 'sselp' command.
|
|
@ -1,21 +0,0 @@
|
|||
# sselp version
|
||||
VERSION = 0.2
|
||||
|
||||
# paths
|
||||
PREFIX = /usr/local
|
||||
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
|
Binary file not shown.
|
@ -1,44 +0,0 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
int
|
||||
main(int argc, char *argv[]) {
|
||||
Atom clip, utf8, type;
|
||||
Display *dpy;
|
||||
Window win;
|
||||
XEvent ev;
|
||||
int fmt;
|
||||
long off = 0;
|
||||
unsigned char *data;
|
||||
unsigned long len, more;
|
||||
|
||||
if(argc > 1 && !strcmp(argv[1], "-v")) {
|
||||
fputs("sselp-"VERSION", © 2006-2010 Anselm R Garbe\n", stdout);
|
||||
return 0;
|
||||
}
|
||||
if(!(dpy = XOpenDisplay(NULL)))
|
||||
return 1;
|
||||
|
||||
utf8 = XInternAtom(dpy, "UTF8_STRING", False);
|
||||
clip = XInternAtom(dpy, "_SSELP_STRING", False);
|
||||
win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 1, 1, 0,
|
||||
CopyFromParent, CopyFromParent);
|
||||
XConvertSelection(dpy, XA_PRIMARY, utf8, clip, win, CurrentTime);
|
||||
|
||||
XNextEvent(dpy, &ev);
|
||||
if(ev.type == SelectionNotify && ev.xselection.property != None) {
|
||||
do {
|
||||
XGetWindowProperty(dpy, win, ev.xselection.property, off, BUFSIZ,
|
||||
False, utf8, &type, &fmt, &len, &more, &data);
|
||||
fwrite(data, 1, len, stdout);
|
||||
XFree(data);
|
||||
off += len/4;
|
||||
}
|
||||
while(more > 0);
|
||||
putchar('\n');
|
||||
}
|
||||
XCloseDisplay(dpy);
|
||||
return 0;
|
||||
}
|
Binary file not shown.
Loading…
Reference in New Issue