From 0305717b693cd0b80de1240f6c0dd8c494a4a9f0 Mon Sep 17 00:00:00 2001 From: cassmodiah Date: Mar 20 2010 18:57:11 +0000 Subject: update to newest git --- diff --git a/.cvsignore b/.cvsignore index 23c2be2..aef60e0 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -i3lock-1.0.tar.gz +i3lock-1.0-20100320git.tar.bz2 diff --git a/i3lock-1.0-189ee55bc074c14d61a900d428401580614a5618.patch b/i3lock-1.0-189ee55bc074c14d61a900d428401580614a5618.patch deleted file mode 100644 index a84e9ce..0000000 --- a/i3lock-1.0-189ee55bc074c14d61a900d428401580614a5618.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 189ee55bc074c14d61a900d428401580614a5618 Mon Sep 17 00:00:00 2001 -From: Jan-Erik Rediger -Date: Fri, 19 Jun 2009 22:52:55 +0100 -Subject: i3lock now can use xpm images as background - ---- -diff --git i3lock-1.0.orig/config.mk i3lock-1.0/config.mk -index 8b2b613..664c254 100644 ---- i3lock-1.0.orig/config.mk -+++ i3lock-1.0/config.mk -@@ -13,7 +13,7 @@ MANDIR = $(DESTDIR)$(PREFIX)/share/man - - # includes and libs - INCS = -I. -I/usr/include -I${X11INC} --LIBS = -L${X11LIB} -lX11 -lpam -lXext -+LIBS = -L${X11LIB} -lX11 -lpam -lXext -lXpm - - # flags - CPPFLAGS = -DVERSION=\"${VERSION}\" -diff --git i3lock-1.0.orig/i3lock.c i3lock-1.0/i3lock.c -index 2c95929..5b495b5 100644 ---- i3lock-1.0.orig/i3lock.c -+++ i3lock-1.0/i3lock.c -@@ -26,6 +26,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -44,6 +45,22 @@ static void die(const char *errstr, ...) { - } - - /* -+ * Check if given file can be opened => exists -+ * -+ */ -+bool file_exists(const char * filename) -+{ -+ FILE * file = fopen(filename, "r"); -+ if(file) -+ { -+ fclose(file); -+ return true; -+ } -+ return false; -+} -+ -+ -+/* - * Callback function for PAM. We only react on password request callbacks. - * - */ -@@ -87,6 +104,8 @@ int main(int argc, char *argv[]) { - bool dont_fork = false; - bool beep = false; - bool dpms = false; -+ bool xpm_image = false; -+ char xpm_image_path[256]; - Cursor invisible; - Display *dpy; - KeySym ksym; -@@ -106,10 +125,11 @@ int main(int argc, char *argv[]) { - {"nofork", no_argument, NULL, 'n'}, - {"beep", no_argument, NULL, 'b'}, - {"dpms", no_argument, NULL, 'd'}, -+ {"image", required_argument, NULL, 'i'}, - {NULL, no_argument, NULL, 0} - }; - -- while ((opt = getopt_long(argc, argv, "vnbd", long_options, &optind)) != -1) { -+ while ((opt = getopt_long(argc, argv, "vnbdi:", long_options, &optind)) != -1) { - switch (opt) { - case 'v': - die("i3lock-"VERSION", © 2009 Michael Stapelberg\n" -@@ -123,8 +143,12 @@ int main(int argc, char *argv[]) { - case 'd': - dpms = true; - break; -+ case 'i': -+ strncpy(xpm_image_path, optarg, 255); -+ xpm_image = true; -+ break; - default: -- die("i3lock: Unknown option. Syntax: i3lock [-v] [-n] [-b] [-d]\n"); -+ die("i3lock: Unknown option. Syntax: i3lock [-v] [-n] [-b] [-d] [-i image.xpm]\n"); - } - } - -@@ -156,6 +180,18 @@ int main(int argc, char *argv[]) { - invisible = XCreatePixmapCursor(dpy, pmap, pmap, &black, &black, 0, 0); - XDefineCursor(dpy, w, invisible); - XMapRaised(dpy, w); -+ -+ if(xpm_image && file_exists(xpm_image_path)) -+ { -+ GC gc = XDefaultGC(dpy, 0); -+ int depth = DefaultDepth(dpy, screen); -+ int disp_width = DisplayWidth(dpy, screen); -+ int disp_height = DisplayHeight(dpy, screen); -+ Pixmap pix = XCreatePixmap(dpy, w, disp_width, disp_height, depth); -+ XpmReadFileToPixmap(dpy, w, xpm_image_path, &pix, 0, 0); -+ XCopyArea(dpy, pix, w, gc, 0, 0, disp_width, disp_height, 0, 0); -+ } -+ - for(len = 1000; len; len--) { - if(XGrabPointer(dpy, root, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, - GrabModeAsync, GrabModeAsync, None, invisible, CurrentTime) == GrabSuccess) --- -cgit v0.8.3 diff --git a/i3lock-1.0-1cddfc4a98efa54203f48de30b9937aaf66a95b4.patch b/i3lock-1.0-1cddfc4a98efa54203f48de30b9937aaf66a95b4.patch deleted file mode 100644 index e6f9271..0000000 --- a/i3lock-1.0-1cddfc4a98efa54203f48de30b9937aaf66a95b4.patch +++ /dev/null @@ -1,159 +0,0 @@ -From 1cddfc4a98efa54203f48de30b9937aaf66a95b4 Mon Sep 17 00:00:00 2001 -From: Jan-Erik Rediger -Date: Sun, 02 Aug 2009 17:59:16 +0100 -Subject: adding option to enable tiling of images - ---- -diff --git i3lock-1.0.orig/config.mk i3lock-1.0/config.mk -index 664c254..78e6237 100644 ---- i3lock-1.0.orig/config.mk -+++ i3lock-1.0/config.mk -@@ -13,7 +13,7 @@ MANDIR = $(DESTDIR)$(PREFIX)/share/man - - # includes and libs - INCS = -I. -I/usr/include -I${X11INC} --LIBS = -L${X11LIB} -lX11 -lpam -lXext -lXpm -+LIBS = -L${X11LIB} -lX11 -lpam -lXext -lXpm -lm - - # flags - CPPFLAGS = -DVERSION=\"${VERSION}\" -diff --git i3lock-1.0.orig/i3lock.1 i3lock-1.0/i3lock.1 -index cb45870..d07af67 100644 ---- i3lock-1.0.orig/i3lock.1 -+++ i3lock-1.0/i3lock.1 -@@ -23,6 +23,7 @@ i3lock \- slightly improved version of slock - .IR image.xpm \|] - .RB [\|\-c - .IR color \|] -+.RB [\|\-t\|] - - .SH DESCRIPTION - .B i3lock -@@ -77,6 +78,11 @@ XPM by using convert(1) from ImageMagick or GIMP for example. - .B \-c, \-\-color - Turns the screen into the given color instead of white. Color must be given in 6-byte format: rrggbb (i.e. ff0000 is red) - -+.TP -+.B \-t, \-\-tiling -+If an image is specified (via -i) it will display the image tiled all over the screen (if it is a multi-monitor setup, the image is visible on all screens) -+>>>>>>> adding option to enable tiling of images:i3lock.1 -+ - .SH AUTHOR - Michael Stapelberg - -diff --git i3lock-1.0.orig/i3lock.c i3lock-1.0/i3lock.c -index 64d2301..adb7020 100644 ---- i3lock-1.0.orig/i3lock.c -+++ i3lock-1.0/i3lock.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -36,6 +37,31 @@ - - static char passwd[256]; - -+/* -+ * displays an xpm image tiled over the whole screen -+ * (the image will be visible on all screens -+ * when using a multi monitor setup) -+ * -+ */ -+void tiling_image(XpmImage *image, -+ int disp_height, int disp_width, -+ Display *dpy, -+ Pixmap pix, -+ Window w, -+ GC gc) { -+ int rows = (int)ceil(disp_height / (float)image->height), -+ cols = (int)ceil(disp_width / (float)image->width); -+ -+ int x = 0, -+ y = 0; -+ -+ for(y = 0; y < rows; y++) { -+ for(x = 0; x < cols; x++) { -+ XCopyArea(dpy, pix, w, gc, 0, 0, image->width, image->height, image->width * x, image->height * y); -+ } -+ } -+} -+ - static void die(const char *errstr, ...) { - va_list ap; - -@@ -151,6 +177,7 @@ int main(int argc, char *argv[]) { - bool beep = false; - bool dpms = false; - bool xpm_image = false; -+ bool tiling = false; - char xpm_image_path[256]; - char color[7] = "ffffff"; // white - Cursor invisible; -@@ -174,10 +201,11 @@ int main(int argc, char *argv[]) { - {"dpms", no_argument, NULL, 'd'}, - {"image", required_argument, NULL, 'i'}, - {"color", required_argument, NULL, 'c'}, -+ {"tiling", no_argument, NULL, 't'}, - {NULL, no_argument, NULL, 0} - }; - -- while ((opt = getopt_long(argc, argv, "vnbdi:c:", long_options, &optind)) != -1) { -+ while ((opt = getopt_long(argc, argv, "vnbdi:c:t", long_options, &optind)) != -1) { - switch (opt) { - case 'v': - die("i3lock-"VERSION", © 2009 Michael Stapelberg\n" -@@ -207,8 +235,11 @@ int main(int argc, char *argv[]) { - - break; - } -+ case 't': -+ tiling = true; -+ break; - default: -- die("i3lock: Unknown option. Syntax: i3lock [-v] [-n] [-b] [-d] [-i image.xpm] [-c color]\n"); -+ die("i3lock: Unknown option. Syntax: i3lock [-v] [-n] [-b] [-d] [-i image.xpm] [-c color] [-t]\n"); - } - } - -@@ -241,19 +272,31 @@ int main(int argc, char *argv[]) { - XDefineCursor(dpy, w, invisible); - XMapRaised(dpy, w); - -- if(xpm_image && file_exists(xpm_image_path)) -- { -+ if (xpm_image && file_exists(xpm_image_path)) { - GC gc = XDefaultGC(dpy, 0); - int depth = DefaultDepth(dpy, screen); - int disp_width = DisplayWidth(dpy, screen); - int disp_height = DisplayHeight(dpy, screen); - Pixmap pix = XCreatePixmap(dpy, w, disp_width, disp_height, depth); -- int err = XpmReadFileToPixmap(dpy, w, xpm_image_path, &pix, 0, 0); -+ XpmImage xpm_image; -+ XpmInfo xpm_info; -+ -+ int err = XpmReadFileToXpmImage(xpm_image_path, &xpm_image, &xpm_info); - if (err != 0) { - print_xpm_error(err); - return 1; - } -- XCopyArea(dpy, pix, w, gc, 0, 0, disp_width, disp_height, 0, 0); -+ -+ err = XpmCreatePixmapFromXpmImage(dpy, w, &xpm_image, &pix, 0, 0); -+ if (err != 0) { -+ print_xpm_error(err); -+ return 1; -+ } -+ -+ if (tiling) -+ tiling_image(&xpm_image, disp_height, disp_width, dpy, pix, w, gc); -+ else -+ XCopyArea(dpy, pix, w, gc, 0, 0, disp_width, disp_height, 0, 0); - } - - for(len = 1000; len; len--) { --- -cgit v0.8.3 diff --git a/i3lock-1.0-206036a852e3d9c598e3fe82d84fd2ac54bbaa55.patch b/i3lock-1.0-206036a852e3d9c598e3fe82d84fd2ac54bbaa55.patch deleted file mode 100644 index 9ff87e8..0000000 --- a/i3lock-1.0-206036a852e3d9c598e3fe82d84fd2ac54bbaa55.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 206036a852e3d9c598e3fe82d84fd2ac54bbaa55 Mon Sep 17 00:00:00 2001 -From: Michael Stapelberg -Date: Sun, 02 Aug 2009 17:50:30 +0100 -Subject: Skip leading # signs for the color, fix input validation - ---- -diff --git i3lock-1.0.orig/i3lock.c i3lock-1.0/i3lock.c -index eca32e9..64d2301 100644 ---- i3lock-1.0.orig/i3lock.c -+++ i3lock-1.0/i3lock.c -@@ -45,7 +45,6 @@ static void die(const char *errstr, ...) { - exit(EXIT_FAILURE); - } - -- - /* - * Returns the colorpixel to use for the given hex color (think of HTML). - * -@@ -197,13 +196,17 @@ int main(int argc, char *argv[]) { - xpm_image = true; - break; - case 'c': -- strncpy(color, optarg, 6); -- color[6] = 0; -+ { -+ char *arg = optarg; -+ /* Skip # if present */ -+ if (arg[0] == '#') -+ arg++; -+ -+ if (strlen(arg) != 6 || sscanf(arg, "%06[0-9a-fA-F]", color) != 1) -+ die("color is invalid, color must be given in 6-byte format: rrggbb\n"); - -- char parsed_color[7]; -- if (strlen(color) != 6 || sscanf(color, "%06[0-9a-fA-F]", parsed_color) != 1) -- die("color is invalid, color must be given in 6-byte format: rrggbb\n"); - break; -+ } - default: - die("i3lock: Unknown option. Syntax: i3lock [-v] [-n] [-b] [-d] [-i image.xpm] [-c color]\n"); - } --- -cgit v0.8.3 diff --git a/i3lock-1.0-25fe0bf00d7519db5c514cdb320870fa52265e2e.patch b/i3lock-1.0-25fe0bf00d7519db5c514cdb320870fa52265e2e.patch deleted file mode 100644 index aa46bdb..0000000 --- a/i3lock-1.0-25fe0bf00d7519db5c514cdb320870fa52265e2e.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 25fe0bf00d7519db5c514cdb320870fa52265e2e Mon Sep 17 00:00:00 2001 -From: Michael Stapelberg -Date: Wed, 19 Aug 2009 19:34:51 +0100 -Subject: Document dependency on libpam in README - ---- -diff --git i3lock-1.0.orig/README i3lock-1.0/README -index 13628e3..13d1ea6 100644 ---- i3lock-1.0.orig/README -+++ i3lock-1.0/README -@@ -12,7 +12,8 @@ i3lock was forked from slock-0.9 - - Requirements - ------------ --In order to build i3lock you need the Xlib header files. -+In order to build i3lock you need the Xlib header files and the PAM development -+headers (libpam-dev or similar). - - - Installation --- -cgit v0.8.3 diff --git a/i3lock-1.0-2e5bee59d5444f84126df845bfb8e02cd252576f.patch b/i3lock-1.0-2e5bee59d5444f84126df845bfb8e02cd252576f.patch deleted file mode 100644 index 6de2a08..0000000 --- a/i3lock-1.0-2e5bee59d5444f84126df845bfb8e02cd252576f.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 2e5bee59d5444f84126df845bfb8e02cd252576f Mon Sep 17 00:00:00 2001 -From: Michael Stapelberg -Date: Thu, 10 Dec 2009 19:24:58 +0100 -Subject: Skip keypresses without entering a password, they cause a delay - -When suspending your system to RAM, a race-condition can occur which -causes many enter keypresses to be sent. These effectively delay -your login by 3 seconds times 50 times (or so), so we just skip empty -passwords. If your password is empty, you don’t need to lock your -screen anyway. ---- -diff --git i3lock-1.0.orig/i3lock.c i3lock-1.0/i3lock.c -index d136ad2..de880c3 100644 ---- i3lock-1.0.orig/i3lock.c -+++ i3lock-1.0/i3lock.c -@@ -335,6 +335,9 @@ int main(int argc, char *argv[]) - switch(ksym) { - case XK_Return: - passwd[len] = 0; -+ /* Skip empty passwords */ -+ if (len == 0) -+ continue; - if ((ret = pam_authenticate(handle, 0)) == PAM_SUCCESS) - running = false; - else { --- -cgit v0.8.3 diff --git a/i3lock-1.0-69a987db550678b640d0f59246e6ac2cd7ce2657.patch b/i3lock-1.0-69a987db550678b640d0f59246e6ac2cd7ce2657.patch deleted file mode 100644 index 6a0612a..0000000 --- a/i3lock-1.0-69a987db550678b640d0f59246e6ac2cd7ce2657.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 69a987db550678b640d0f59246e6ac2cd7ce2657 Mon Sep 17 00:00:00 2001 -From: Michael Stapelberg -Date: Sat, 27 Jun 2009 20:35:59 +0100 -Subject: Handle error codes when loading the pixmap - ---- -diff --git i3lock-1.0.orig/i3lock.c i3lock-1.0/i3lock.c -index 5b495b5..a824c6a 100644 ---- i3lock-1.0.orig/i3lock.c -+++ i3lock-1.0/i3lock.c -@@ -48,7 +48,7 @@ static void die(const char *errstr, ...) { - * Check if given file can be opened => exists - * - */ --bool file_exists(const char * filename) -+bool file_exists(const char *filename) - { - FILE * file = fopen(filename, "r"); - if(file) -@@ -59,6 +59,31 @@ bool file_exists(const char * filename) - return false; - } - -+/* -+ * Puts the given XPM error code to stderr -+ * -+ */ -+void print_xpm_error(int err) -+{ -+ switch (err) { -+ case XpmColorError: -+ fprintf(stderr, "XPM: Could not parse or alloc requested color\n"); -+ break; -+ case XpmOpenFailed: -+ fprintf(stderr, "XPM: Cannot open file\n"); -+ break; -+ case XpmFileInvalid: -+ fprintf(stderr, "XPM: invalid XPM file\n"); -+ break; -+ case XpmNoMemory: -+ fprintf(stderr, "XPM: Not enough memory\n"); -+ break; -+ case XpmColorFailed: -+ fprintf(stderr, "XPM: Color not found\n"); -+ break; -+ } -+} -+ - - /* - * Callback function for PAM. We only react on password request callbacks. -@@ -188,12 +213,16 @@ int main(int argc, char *argv[]) { - int disp_width = DisplayWidth(dpy, screen); - int disp_height = DisplayHeight(dpy, screen); - Pixmap pix = XCreatePixmap(dpy, w, disp_width, disp_height, depth); -- XpmReadFileToPixmap(dpy, w, xpm_image_path, &pix, 0, 0); -+ int err = XpmReadFileToPixmap(dpy, w, xpm_image_path, &pix, 0, 0); -+ if (err != 0) { -+ print_xpm_error(err); -+ return 1; -+ } - XCopyArea(dpy, pix, w, gc, 0, 0, disp_width, disp_height, 0, 0); - } - - for(len = 1000; len; len--) { -- if(XGrabPointer(dpy, root, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, -+ if(XGrabPointer(dpy, root, False, ButtonPressMask | ButtonReleaseMask, - GrabModeAsync, GrabModeAsync, None, invisible, CurrentTime) == GrabSuccess) - break; - usleep(1000); --- -cgit v0.8.3 diff --git a/i3lock-1.0-9c4dee2e8633d4ff2c9787fc3f1b6591338c41f5.patch b/i3lock-1.0-9c4dee2e8633d4ff2c9787fc3f1b6591338c41f5.patch deleted file mode 100644 index 45da980..0000000 --- a/i3lock-1.0-9c4dee2e8633d4ff2c9787fc3f1b6591338c41f5.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 9c4dee2e8633d4ff2c9787fc3f1b6591338c41f5 Mon Sep 17 00:00:00 2001 -From: Jan-Erik Rediger -Date: Fri, 31 Jul 2009 19:35:40 +0100 -Subject: adding option to choose background color - ---- -diff --git i3lock-1.0.orig/i3lock.1 i3lock-1.0/i3lock.1 -index 214d22a..cb45870 100644 ---- i3lock-1.0.orig/i3lock.1 -+++ i3lock-1.0/i3lock.1 -@@ -21,10 +21,12 @@ i3lock \- slightly improved version of slock - .RB [\|\-d\|] - .RB [\|\-i - .IR image.xpm \|] -+.RB [\|\-c -+.IR color \|] - - .SH DESCRIPTION - .B i3lock --locks your screen by making it white. To quit -+locks your screen by making it white (default). To quit - .B i3lock - just enter your password. - -@@ -71,6 +73,10 @@ you did not disable this in your X server). - Display the given XPM image instead of a blank screen. You can convert an image to - XPM by using convert(1) from ImageMagick or GIMP for example. - -+.TP -+.B \-c, \-\-color -+Turns the screen into the given color instead of white. Color must be given in 6-byte format: rrggbb (i.e. ff0000 is red) -+ - .SH AUTHOR - Michael Stapelberg - -diff --git i3lock-1.0.orig/i3lock.c i3lock-1.0/i3lock.c -index a824c6a..eca32e9 100644 ---- i3lock-1.0.orig/i3lock.c -+++ i3lock-1.0/i3lock.c -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -44,6 +45,27 @@ static void die(const char *errstr, ...) { - exit(EXIT_FAILURE); - } - -+ -+/* -+ * Returns the colorpixel to use for the given hex color (think of HTML). -+ * -+ * The hex_color may not start with #, for example FF00FF works. -+ * -+ * NOTE that get_colorpixel() does _NOT_ check the given color code for validity. -+ * This has to be done by the caller. -+ * -+ */ -+uint32_t get_colorpixel(char *hex) { -+ char strgroups[3][3] = {{hex[0], hex[1], '\0'}, -+ {hex[2], hex[3], '\0'}, -+ {hex[4], hex[5], '\0'}}; -+ uint32_t rgb16[3] = {(strtol(strgroups[0], NULL, 16)), -+ (strtol(strgroups[1], NULL, 16)), -+ (strtol(strgroups[2], NULL, 16))}; -+ -+ return (rgb16[0] << 16) + (rgb16[1] << 8) + rgb16[2]; -+} -+ - /* - * Check if given file can be opened => exists - * -@@ -131,6 +153,7 @@ int main(int argc, char *argv[]) { - bool dpms = false; - bool xpm_image = false; - char xpm_image_path[256]; -+ char color[7] = "ffffff"; // white - Cursor invisible; - Display *dpy; - KeySym ksym; -@@ -151,10 +174,11 @@ int main(int argc, char *argv[]) { - {"beep", no_argument, NULL, 'b'}, - {"dpms", no_argument, NULL, 'd'}, - {"image", required_argument, NULL, 'i'}, -+ {"color", required_argument, NULL, 'c'}, - {NULL, no_argument, NULL, 0} - }; - -- while ((opt = getopt_long(argc, argv, "vnbdi:", long_options, &optind)) != -1) { -+ while ((opt = getopt_long(argc, argv, "vnbdi:c:", long_options, &optind)) != -1) { - switch (opt) { - case 'v': - die("i3lock-"VERSION", © 2009 Michael Stapelberg\n" -@@ -172,8 +196,16 @@ int main(int argc, char *argv[]) { - strncpy(xpm_image_path, optarg, 255); - xpm_image = true; - break; -+ case 'c': -+ strncpy(color, optarg, 6); -+ color[6] = 0; -+ -+ char parsed_color[7]; -+ if (strlen(color) != 6 || sscanf(color, "%06[0-9a-fA-F]", parsed_color) != 1) -+ die("color is invalid, color must be given in 6-byte format: rrggbb\n"); -+ break; - default: -- die("i3lock: Unknown option. Syntax: i3lock [-v] [-n] [-b] [-d] [-i image.xpm]\n"); -+ die("i3lock: Unknown option. Syntax: i3lock [-v] [-n] [-b] [-d] [-i image.xpm] [-c color]\n"); - } - } - -@@ -196,7 +228,7 @@ int main(int argc, char *argv[]) { - - /* init */ - wa.override_redirect = 1; -- wa.background_pixel = WhitePixel(dpy, screen); -+ wa.background_pixel = get_colorpixel(color); - w = XCreateWindow(dpy, root, 0, 0, DisplayWidth(dpy, screen), DisplayHeight(dpy, screen), - 0, DefaultDepth(dpy, screen), CopyFromParent, - DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixel, &wa); --- -cgit v0.8.3 diff --git a/i3lock-1.0-c1a91badbed68ab63e1109bf74902e2f88bae008.patch b/i3lock-1.0-c1a91badbed68ab63e1109bf74902e2f88bae008.patch deleted file mode 100644 index 916bbc9..0000000 --- a/i3lock-1.0-c1a91badbed68ab63e1109bf74902e2f88bae008.patch +++ /dev/null @@ -1,42 +0,0 @@ -From c1a91badbed68ab63e1109bf74902e2f88bae008 Mon Sep 17 00:00:00 2001 -From: Michael Stapelberg -Date: Sat, 27 Jun 2009 21:06:44 +0100 -Subject: Document the new option in the manpage - ---- -diff --git i3lock-1.0.orig/i3lock.1 i3lock-1.0/i3lock.1 -index 922c153..214d22a 100644 ---- i3lock-1.0.orig/i3lock.1 -+++ i3lock-1.0/i3lock.1 -@@ -8,7 +8,7 @@ - .fi - .. - --.TH i3lock 1 "MAY 2009" Linux "User Manuals" -+.TH i3lock 1 "JUNE 2009" Linux "User Manuals" - - .SH NAME - i3lock \- slightly improved version of slock -@@ -19,6 +19,8 @@ i3lock \- slightly improved version of slock - .RB [\|\-n\|] - .RB [\|\-b\|] - .RB [\|\-d\|] -+.RB [\|\-i -+.IR image.xpm \|] - - .SH DESCRIPTION - .B i3lock -@@ -64,6 +66,11 @@ Enable turning off your screen using DPMS. Note that, when you do not specify th - option, DPMS will turn off your screen after 15 minutes of inactivity anyways (if - you did not disable this in your X server). - -+.TP -+.B \-i, \-\-image -+Display the given XPM image instead of a blank screen. You can convert an image to -+XPM by using convert(1) from ImageMagick or GIMP for example. -+ - .SH AUTHOR - Michael Stapelberg - --- -cgit v0.8.3 diff --git a/i3lock-1.0-ef1d47ce5b663ccc75f8387021bcc4a9e75b2a5d.patch b/i3lock-1.0-ef1d47ce5b663ccc75f8387021bcc4a9e75b2a5d.patch deleted file mode 100644 index a4f8f0b..0000000 --- a/i3lock-1.0-ef1d47ce5b663ccc75f8387021bcc4a9e75b2a5d.patch +++ /dev/null @@ -1,224 +0,0 @@ -From ef1d47ce5b663ccc75f8387021bcc4a9e75b2a5d Mon Sep 17 00:00:00 2001 -From: Michael Stapelberg -Date: Sun, 02 Aug 2009 19:47:39 +0100 -Subject: Some small cleanups - ---- -diff --git i3lock-1.0.orig/i3lock.1 i3lock-1.0/i3lock.1 -index d07af67..35df6e0 100644 ---- i3lock-1.0.orig/i3lock.1 -+++ i3lock-1.0/i3lock.1 -@@ -8,7 +8,7 @@ - .fi - .. - --.TH i3lock 1 "JUNE 2009" Linux "User Manuals" -+.TH i3lock 1 "AUGUST 2009" Linux "User Manuals" - - .SH NAME - i3lock \- slightly improved version of slock -@@ -38,9 +38,11 @@ improves slock by making it fork() and therefore combinable with - commands to suspend your computer. Additionally, instead of turning off - your screen via DPMS and/or displaying a black screen, - .B i3lock --displays a white screen so you can see if your computer failed to resume --from suspend or if your screen is just locked. Also, when entering a wrong --password, -+displays a white (or colored in your favorite color) screen so you can see -+if your computer failed to resume from suspend or if your screen is just -+locked. Since version 1.1, -+.B i3lock -+can display images in XPM file format. Also, when entering a wrong password, - .B i3lock - does not call XBell(). This is important because - .B i3lock/slock -@@ -76,14 +78,17 @@ XPM by using convert(1) from ImageMagick or GIMP for example. - - .TP - .B \-c, \-\-color --Turns the screen into the given color instead of white. Color must be given in 6-byte format: rrggbb (i.e. ff0000 is red) -+Turns the screen into the given color instead of white. Color must be given in 6-byte -+format: rrggbb (i.e. ff0000 is red) - - .TP --.B \-t, \-\-tiling --If an image is specified (via -i) it will display the image tiled all over the screen (if it is a multi-monitor setup, the image is visible on all screens) -->>>>>>> adding option to enable tiling of images:i3lock.1 -+.B \-t, \-\-tile -+If an image is specified (via -i) it will display the image tiled all over the screen -+(if it is a multi-monitor setup, the image is visible on all screens). - - .SH AUTHOR - Michael Stapelberg - -+Jan-Erik Rediger -+ - forked from slock-0.9 by Anselm R Garbe -diff --git i3lock-1.0.orig/i3lock.c i3lock-1.0/i3lock.c -index adb7020..d136ad2 100644 ---- i3lock-1.0.orig/i3lock.c -+++ i3lock-1.0/i3lock.c -@@ -4,6 +4,7 @@ - * i3lock - an improved version of slock - * - * i3lock © 2009 Michael Stapelberg and contributors -+ * i3lock © 2009 Jan-Erik Rediger - * slock © 2006-2008 Anselm R Garbe - * - * See file LICENSE for license information. -@@ -32,6 +33,7 @@ - #include - #include - #include -+#include - - #include - -@@ -43,32 +45,19 @@ static char passwd[256]; - * when using a multi monitor setup) - * - */ --void tiling_image(XpmImage *image, -- int disp_height, int disp_width, -- Display *dpy, -- Pixmap pix, -- Window w, -- GC gc) { -- int rows = (int)ceil(disp_height / (float)image->height), -- cols = (int)ceil(disp_width / (float)image->width); -- -- int x = 0, -- y = 0; -- -- for(y = 0; y < rows; y++) { -- for(x = 0; x < cols; x++) { -- XCopyArea(dpy, pix, w, gc, 0, 0, image->width, image->height, image->width * x, image->height * y); -+static void tile_image(XpmImage *image, int disp_height, int disp_width, -+ Display *dpy, Pixmap pix, Window w, GC gc) -+{ -+ int rows = (int)ceil(disp_height / (float)image->height), -+ cols = (int)ceil(disp_width / (float)image->width); -+ -+ for (int y = 0; y < rows; y++) { -+ for (int x = 0; x < cols; x++) { -+ XCopyArea(dpy, pix, w, gc, 0, 0, -+ image->width, image->height, -+ image->width * x, image->height * y); -+ } - } -- } --} -- --static void die(const char *errstr, ...) { -- va_list ap; -- -- va_start(ap, errstr); -- vfprintf(stderr, errstr, ap); -- va_end(ap); -- exit(EXIT_FAILURE); - } - - /* -@@ -80,7 +69,7 @@ static void die(const char *errstr, ...) { - * This has to be done by the caller. - * - */ --uint32_t get_colorpixel(char *hex) { -+static uint32_t get_colorpixel(char *hex) { - char strgroups[3][3] = {{hex[0], hex[1], '\0'}, - {hex[2], hex[3], '\0'}, - {hex[4], hex[5], '\0'}}; -@@ -95,7 +84,7 @@ uint32_t get_colorpixel(char *hex) { - * Check if given file can be opened => exists - * - */ --bool file_exists(const char *filename) -+static bool file_exists(const char *filename) - { - FILE * file = fopen(filename, "r"); - if(file) -@@ -110,7 +99,7 @@ bool file_exists(const char *filename) - * Puts the given XPM error code to stderr - * - */ --void print_xpm_error(int err) -+static void print_xpm_error(int err) - { - switch (err) { - case XpmColorError: -@@ -137,7 +126,8 @@ void print_xpm_error(int err) - * - */ - static int conv_callback(int num_msg, const struct pam_message **msg, -- struct pam_response **resp, void *appdata_ptr) { -+ struct pam_response **resp, void *appdata_ptr) -+{ - if (num_msg == 0) - return 1; - -@@ -163,7 +153,8 @@ static int conv_callback(int num_msg, const struct pam_message **msg, - return 0; - } - --int main(int argc, char *argv[]) { -+int main(int argc, char *argv[]) -+{ - char curs[] = {0, 0, 0, 0, 0, 0, 0, 0}; - char buf[32]; - char *username; -@@ -208,7 +199,7 @@ int main(int argc, char *argv[]) { - while ((opt = getopt_long(argc, argv, "vnbdi:c:t", long_options, &optind)) != -1) { - switch (opt) { - case 'v': -- die("i3lock-"VERSION", © 2009 Michael Stapelberg\n" -+ errx(0, "i3lock-"VERSION", © 2009 Michael Stapelberg\n" - "based on slock, which is © 2006-2008 Anselm R Garbe\n"); - case 'n': - dont_fork = true; -@@ -231,7 +222,7 @@ int main(int argc, char *argv[]) { - arg++; - - if (strlen(arg) != 6 || sscanf(arg, "%06[0-9a-fA-F]", color) != 1) -- die("color is invalid, color must be given in 6-byte format: rrggbb\n"); -+ errx(1, "color is invalid, color must be given in 6-byte format: rrggbb\n"); - - break; - } -@@ -239,19 +230,19 @@ int main(int argc, char *argv[]) { - tiling = true; - break; - default: -- die("i3lock: Unknown option. Syntax: i3lock [-v] [-n] [-b] [-d] [-i image.xpm] [-c color] [-t]\n"); -+ errx(1, "i3lock: Unknown option. Syntax: i3lock [-v] [-n] [-b] [-d] [-i image.xpm] [-c color] [-t]\n"); - } - } - - if ((username = getenv("USER")) == NULL) -- die("USER environment variable not set, please set it.\n"); -+ errx(1, "USER environment variable not set, please set it.\n"); - - int ret = pam_start("i3lock", username, &conv, &handle); - if (ret != PAM_SUCCESS) -- die("PAM: %s\n", pam_strerror(handle, ret)); -+ errx(1, "PAM: %s\n", pam_strerror(handle, ret)); - - if(!(dpy = XOpenDisplay(0))) -- die("i3lock: cannot open display\n"); -+ errx(1, "i3lock: cannot open display\n"); - screen = DefaultScreen(dpy); - root = RootWindow(dpy, screen); - -@@ -294,9 +285,9 @@ int main(int argc, char *argv[]) { - } - - if (tiling) -- tiling_image(&xpm_image, disp_height, disp_width, dpy, pix, w, gc); -+ tile_image(&xpm_image, disp_height, disp_width, dpy, pix, w, gc); - else -- XCopyArea(dpy, pix, w, gc, 0, 0, disp_width, disp_height, 0, 0); -+ XCopyArea(dpy, pix, w, gc, 0, 0, disp_width, disp_height, 0, 0); - } - - for(len = 1000; len; len--) { --- -cgit v0.8.3 diff --git a/i3lock.spec b/i3lock.spec index c1da5f8..16663a6 100644 --- a/i3lock.spec +++ b/i3lock.spec @@ -1,36 +1,22 @@ +%global git 20100320git +%global gitversion 2e5bee5 + Name: i3lock Version: 1.0 -Release: 3%{?dist} +Release: 4.%{git}%{?dist} Summary: Simple X display locker Group: User Interface/Desktops License: MIT URL: http://i3.zekjur.net/i3lock/ -Source0: http://i3.zekjur.net/%{name}/%{name}-%{version}.tar.gz +#Source0: http://i3.zekjur.net/%{name}/%{name}-%{version}.tar.bz2 +# git clone git://code.stapelberg.de/%{name} +# cd %{name} && git reset --hard %{gitversion} && rm -rf .git .gitingore && cd .. +# tar -czvf {name}-%{upstream_version}-%{git}.tar.bz2 %{name} +Source0: %{name}-%{version}-%{git}.tar.bz2 Source1: %{name}.pam BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -# i3lock now can use xpm images as background -Patch0: %{name}-1.0-189ee55bc074c14d61a900d428401580614a5618.patch -# Handle error codes when loading the pixmap -Patch1: %{name}-1.0-69a987db550678b640d0f59246e6ac2cd7ce2657.patch -# Document the new option in the manpage -Patch2: %{name}-1.0-c1a91badbed68ab63e1109bf74902e2f88bae008.patch -# adding option to choose background color -Patch3: %{name}-1.0-9c4dee2e8633d4ff2c9787fc3f1b6591338c41f5.patch -# Skip leading # signs for the color, fix input validation -Patch4: %{name}-1.0-206036a852e3d9c598e3fe82d84fd2ac54bbaa55.patch -# adding option to enable tiling of images -Patch5: %{name}-1.0-1cddfc4a98efa54203f48de30b9937aaf66a95b4.patch -# Some small cleanups -Patch6: %{name}-1.0-ef1d47ce5b663ccc75f8387021bcc4a9e75b2a5d.patch -# Document dependency on libpam in README -Patch7: %{name}-1.0-25fe0bf00d7519db5c514cdb320870fa52265e2e.patch -# Skip keypresses without entering a password, they cause a delay -Patch8: %{name}-1.0-2e5bee59d5444f84126df845bfb8e02cd252576f.patch - - - BuildRequires: libX11-devel BuildRequires: pam-devel BuildRequires: libXext-devel @@ -48,19 +34,10 @@ resuming from suspend, at least sometimes. %prep -%setup -q - -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -sed -e 's|CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}|CFLAGS = -std=c99 -pedantic %{optflags} ${INCS} ${CPPFLAGS}|g' \ +%setup -q -n %{name} + +sed \ + -e 's|CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}|CFLAGS = -std=c99 -pedantic %{optflags} ${INCS} ${CPPFLAGS}|g' \ -e 's|LDFLAGS = -s ${LIBS}|LDFLAGS = ${LIBS}|g' \ -i config.mk @@ -93,17 +70,11 @@ rm -rf %{buildroot} %changelog +* Sat Mar 20 2010 Simon Wesp - 1.0-4.20100320git +- Update to current git + * Sat Feb 05 2010 Simon Wesp - 1.0-3 - Some bugfixes (sync with upstream) -- Add patch http://code.stapelberg.de/git/i3lock/commit/?id=189ee55bc074c14d61a900d428401580614a5618 -- Add patch http://code.stapelberg.de/git/i3lock/commit/?id=69a987db550678b640d0f59246e6ac2cd7ce2657 -- Add patch http://code.stapelberg.de/git/i3lock/commit/?id=c1a91badbed68ab63e1109bf74902e2f88bae008 -- Add patch http://code.stapelberg.de/git/i3lock/commit/?id=9c4dee2e8633d4ff2c9787fc3f1b6591338c41f5 -- Add patch http://code.stapelberg.de/git/i3lock/commit/?id=206036a852e3d9c598e3fe82d84fd2ac54bbaa55 -- Add patch http://code.stapelberg.de/git/i3lock/commit/?id=1cddfc4a98efa54203f48de30b9937aaf66a95b4 -- Add patch http://code.stapelberg.de/git/i3lock/commit/?id=ef1d47ce5b663ccc75f8387021bcc4a9e75b2a5d -- Add patch http://code.stapelberg.de/git/i3lock/commit/?id=25fe0bf00d7519db5c514cdb320870fa52265e2e -- Add patch http://code.stapelberg.de/git/i3lock/commit/?id=2e5bee59d5444f84126df845bfb8e02cd252576f * Sat Jan 09 2010 Simon Wesp - 1.0-2 - Add a PAM configfile as SOURCE1 diff --git a/import.log b/import.log index 100f176..4f08126 100644 --- a/import.log +++ b/import.log @@ -1 +1,2 @@ i3lock-1_0-1_fc12:HEAD:i3lock-1.0-1.fc12.src.rpm:1259783201 +i3lock-1_0-4_20100320git_fc12:HEAD:i3lock-1.0-4.20100320git.fc12.src.rpm:1269111318 diff --git a/sources b/sources index b9b2cf4..66c7a5e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -27db4766271d0c7ea3bbb14ac7b9932c i3lock-1.0.tar.gz +760bcd0a78fc0f3053b6b65757c4f7f9 i3lock-1.0-20100320git.tar.bz2