[hackers] [xssstate] Rename to xssstate and do it right. || Christoph Lohmann

From: <git_AT_suckless.org>
Date: Sat, 08 Dec 2012 22:33:25 +0100

commit f91e73ae451c1137da79019bb5a08daaca5f6323
Author: Christoph Lohmann <20h_AT_r-36.net>
Date: Sat Dec 8 22:31:19 2012 +0100

    Rename to xssstate and do it right.

diff --git a/Makefile b/Makefile
index 01172a2..f4a6be3 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -1,15 +1,14 @@
-# xgetidle – display the X idle time
 # See LICENSE file for copyright and license details.
 
 include config.mk
 
-SRC = xgetidle.c
+SRC = xssstate.c
 OBJ = ${SRC:.c=.o}
 
-all: options xgetidle
+all: options xssstate
 
 options:
- _AT_echo xgetidle build options:
+ _AT_echo xssstate build options:
         _AT_echo "CFLAGS = ${CFLAGS}"
         _AT_echo "LDFLAGS = ${LDFLAGS}"
         _AT_echo "CC = ${CC}"
_AT_@ -20,37 +19,37 @@ options:
 
 ${OBJ}: config.mk
 
-xgetidle: xgetidle.o
+xssstate: xssstate.o
         _AT_echo CC -o $@
- _AT_${CC} -o $@ xgetidle.o ${LDFLAGS}
+ _AT_${CC} -o $@ xssstate.o ${LDFLAGS}
 
 clean:
         _AT_echo cleaning
- _AT_rm -f xgetidle ${OBJ} xgetidle-${VERSION}.tar.gz
+ _AT_rm -f xssstate ${OBJ} xssstate-${VERSION}.tar.gz
 
 dist: clean
         _AT_echo creating dist tarball
- _AT_mkdir -p xgetidle-${VERSION}
+ _AT_mkdir -p xssstate-${VERSION}
         _AT_cp -R LICENSE Makefile config.mk \
- xgetidle.1 arg.h ${SRC} xgetidle-${VERSION}
- _AT_tar -cf xgetidle-${VERSION}.tar xgetidle-${VERSION}
- _AT_gzip xgetidle-${VERSION}.tar
- _AT_rm -rf xgetidle-${VERSION}
+ xssstate.1 arg.h ${SRC} xssstate-${VERSION}
+ _AT_tar -cf xssstate-${VERSION}.tar xssstate-${VERSION}
+ _AT_gzip xssstate-${VERSION}.tar
+ _AT_rm -rf xssstate-${VERSION}
 
 install: all
         _AT_echo installing executable file to ${DESTDIR}${PREFIX}/bin
         _AT_mkdir -p ${DESTDIR}${PREFIX}/bin
- _AT_cp -f xgetidle ${DESTDIR}${PREFIX}/bin
- _AT_chmod 755 ${DESTDIR}${PREFIX}/bin/xgetidle
+ _AT_cp -f xssstate ${DESTDIR}${PREFIX}/bin
+ _AT_chmod 755 ${DESTDIR}${PREFIX}/bin/xssstate
         _AT_echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
         _AT_mkdir -p ${DESTDIR}${MANPREFIX}/man1
- _AT_sed "s/VERSION/${VERSION}/g" < xgetidle.1 > ${DESTDIR}${MANPREFIX}/man1/xgetidle.1
- _AT_chmod 644 ${DESTDIR}${MANPREFIX}/man1/xgetidle.1
+ _AT_sed "s/VERSION/${VERSION}/g" < xssstate.1 > ${DESTDIR}${MANPREFIX}/man1/xssstate.1
+ _AT_chmod 644 ${DESTDIR}${MANPREFIX}/man1/xssstate.1
 
 uninstall:
         _AT_echo removing executable file from ${DESTDIR}${PREFIX}/bin
- _AT_rm -f ${DESTDIR}${PREFIX}/bin/xgetidle
+ _AT_rm -f ${DESTDIR}${PREFIX}/bin/xssstate
         _AT_echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
- _AT_rm -f ${DESTDIR}${MANPREFIX}/man1/xgetidle.1
+ _AT_rm -f ${DESTDIR}${MANPREFIX}/man1/xssstate.1
 
 .PHONY: all options clean dist install uninstall
diff --git a/config.mk b/config.mk
index 4916434..0e9a776 100644
--- a/config.mk
+++ b/config.mk
_AT_@ -1,4 +1,4 @@
-# xgetidle version
+# xssstate version
 VERSION = 1.0
 
 # Customize below to fit your system
diff --git a/xgetidle.1 b/xgetidle.1
deleted file mode 100644
index 0a3de20..0000000
--- a/xgetidle.1
+++ /dev/null
_AT_@ -1,27 +0,0 @@
-.TH XGETIDLE 1 xgetidle\-VERSION
-.SH NAME
-xgetidle \- display the current X idle time
-.SH SYNOPSIS
-.B xgetidle
-.RB [ \-s ]
-.RB [ \-v ]
-.SH DESCRIPTION
-.B xgetidle
-will display the current idle time of X11 given the XScreenSaver extension.
-.SH OPTIONS
-.TP
-.B \-s
-display the result in seconds
-.TP
-.B \-v
-show version information
-.SH AUTHORS
-See the LICENSE file for the authors.
-.SH LICENSE
-See the LICENSE file for the terms of redistribution.
-.SH SEE ALSO
-.BR slock (1)
-.BR xlock (1)
-.SH BUGS
-Please report them.
-
diff --git a/xgetidle.c b/xgetidle.c
deleted file mode 100644
index 0bf2617..0000000
--- a/xgetidle.c
+++ /dev/null
_AT_@ -1,68 +0,0 @@
-/*
- * See LICENSE file for copyright and license details.
- */
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdbool.h>
-#include <libgen.h>
-#include <X11/extensions/scrnsaver.h>
-
-#include "arg.h"
-
-char *argv0;
-
-void
-die(const char *errstr, ...) {
- va_list ap;
-
- va_start(ap, errstr);
- vfprintf(stderr, errstr, ap);
- va_end(ap);
- exit(EXIT_FAILURE);
-}
-
-void
-usage(void)
-{
- die("usage: %s [-sv]
", basename(argv0));
-}
-
-int
-main(int argc, char *argv[]) {
- XScreenSaverInfo *info;
- Display *dpy;
- int base, errbase;
- Bool inseconds;
-
- inseconds = False;
-
- ARGBEGIN {
- case 's':
- inseconds = true;
- break;
- case 'v':
- die("xgetidle-"VERSION", © 2008-2012 xgetidle engineers"
- ", see LICENSE for details.
");
- default:
- usage();
- } ARGEND;
-
- if(!(dpy = XOpenDisplay(0)))
- die("Cannot open display.
");
-
- if(!XScreenSaverQueryExtension(dpy, &base, &errbase))
- die("Screensaver extension not activated.
");
-
- info = XScreenSaverAllocInfo();
- XScreenSaverQueryInfo(dpy, DefaultRootWindow(dpy), info);
-
- printf("%ld
", info->idle / ((inseconds)? 1000 : 1));
-
- XCloseDisplay(dpy);
-
- return 0;
-}
-
Received on Sat Dec 08 2012 - 22:33:25 CET

This archive was generated by hypermail 2.3.0 : Sat Dec 08 2012 - 22:36:05 CET