sselp

simple X selection printer to stdout
git clone git://git.suckless.org/sselp
Log | Files | Refs | README | LICENSE

commit 9314ce649fa36774f28a52254ae08a1dad27b503
parent 80ba5e4b7522e6cef80ebebd35a43e72a1a2314e
Author: anselm@anselm1 <unknown>
Date:   Sun, 20 Apr 2008 12:29:14 +0100

sselp update, add UTF8 support
Diffstat:
MLICENSE | 2+-
MMakefile | 1-
Mconfig.mk | 2+-
Msselp.c | 9+++++----
4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/LICENSE b/LICENSE @@ -1,6 +1,6 @@ MIT/X Consortium License -(C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com> +(C)opyright 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"), diff --git a/Makefile b/Makefile @@ -1,5 +1,4 @@ # sselp - simple print selection -# (C)opyright MMVI Anselm R. Garbe include config.mk diff --git a/config.mk b/config.mk @@ -1,5 +1,5 @@ # sselp version -VERSION = 0.1 +VERSION = 0.2 # Customize below to fit your system diff --git a/sselp.c b/sselp.c @@ -1,5 +1,4 @@ -/* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com> - * See LICENSE file for license details. +/* See LICENSE file for license details. */ #include <stdlib.h> #include <stdio.h> @@ -24,6 +23,7 @@ emallocz(unsigned int size) { static unsigned char * getselection(unsigned long offset, unsigned long *len, unsigned long *remain) { Display *dpy; + Atom utf8_string; Atom xa_clip_string; Window w; XEvent ev; @@ -35,10 +35,11 @@ getselection(unsigned long offset, unsigned long *len, unsigned long *remain) { dpy = XOpenDisplay(NULL); if(!dpy) return NULL; - xa_clip_string = XInternAtom(dpy, "BLITZ_SEL_STRING", False); + utf8_string = XInternAtom(dpy, "UTF8_STRING", False); + xa_clip_string = XInternAtom(dpy, "_SSELP_STRING", False); w = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10, 10, 200, 200, 1, CopyFromParent, CopyFromParent); - XConvertSelection(dpy, XA_PRIMARY, XA_STRING, xa_clip_string, + XConvertSelection(dpy, XA_PRIMARY, utf8_string, xa_clip_string, w, CurrentTime); XFlush(dpy); XNextEvent(dpy, &ev);