debian/0000755000000000000000000000000011421413417007164 5ustar debian/README.source0000644000000000000000000000274311410204423011342 0ustar This package uses dpatch to manage all modifications to the upstream source. Changes are stored in the source package as diffs in debian/patches and applied during the build. To get the fully patched source after unpacking the source package, cd to the root level of the source package and run: debian/rules patch Removing a patch is as simple as removing its entry from the debian/patches/00list file, and please also remove the patch file itself. Creating a new patch is done with "dpatch-edit-patch patch XX_patchname" where you should replace XX with a new number and patchname with a descriptive shortname of the patch. You can then simply edit all the files your patch wants to edit, and then simply "exit 0" from the shell to actually create the patch file. To tweak an already existing patch, call "dpatch-edit-patch XX_patchname" and replace XX_patchname with the actual filename from debian/patches you want to use. To clean up afterwards again, "debian/rules unpatch" will do the work for you - or you can of course choose to call "fakeroot debian/rules clean" all together. --- this documentation is part of dpatch package, and may be used by packages using dpatch to comply with policy on README.source. This documentation is meant to be useful to users who are not proficient in dpatch in doing work with dpatch-based packages. Please send any improvements to the BTS of dpatch package. original text by Gerfried Fuchs, edited by Junichi Uekawa 10 Aug 2008. debian/copyright0000644000000000000000000000532711410204423011117 0ustar This package was debianized by Laurence J. Lane on Mon, 30 Oct 2000 20:19:08 -0500. It was downloaded from: http://linuxbrit.co.uk/downloads/ Upstream Author: Tom Gilbert Copyright: Copyright (C) 1999,2000 Tom Gilbert. 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 of the Software and its documentation and acknowledgment shall be given in the documentation and software packages that this Software was used. 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 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. ------------------------------------------------------------------------------- src/getopt.c, src/getopt1.c: GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/LGPL-2 file. ------------------------------------------------------------------------------- src/main.c, src/options.c, src/imlib.c: Copyright (c) The Regents of the University of California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. debian/changelog0000644000000000000000000001030211421413127011030 0ustar scrot (0.8-13) unstable; urgency=low * Changed patch system to 'quilt' -- William Vera Tue, 20 Jul 2010 16:32:55 -0500 scrot (0.8-12) unstable; urgency=low * Added a patch to fix missing option for beep prevention. (Closes: #586769) Thanks to Ibragimov Rinat * Updated Standards Version to 3.9.0. * Updated debhelper version. * Added ${misc:Depends} in control file. * Added DM Upload Allowed in control file. * Switch to dpkg-source 3.0 (quilt) format. * Added a patch to fix a minus sign in a manpage. -- William Vera Wed, 30 Jun 2010 10:00:05 -0500 scrot (0.8-11) unstable; urgency=low * Changed the Homepage field on control file (Closes: #547486). * Updated Standards Version to 3.8.1. * Added a patch to improve spacing in manual page (Closes: #549123). * Added a README.source (dpatch). * Added a patch to prevent arbitrary long file names (Closes: #354662). -- William Vera Sun, 25 Oct 2009 19:48:21 -0600 scrot (0.8-10) unstable; urgency=low * Added a patch to automatically choose focused window (Closes: #245266). * New patch to add this function at he manpage. -- William Vera Tue, 19 May 2009 09:27:27 -0500 scrot (0.8-9) unstable; urgency=low * Changed the description on manpage (Closes: #469914). * Updated the Standards-Version to 3.8.1. * Fixed deprecated dh_clean -k in debian/rules file. -- William Vera Wed, 13 May 2009 06:48:15 -0500 scrot (0.8-8) unstable; urgency=low * New maintainer (Closes: #492502). * Updated Standards Version to 3.8.0 * Added autotool-dev as Build-Depend. * Added watch file. * Added a patch to fix a minor error on manpage. * Set auto update libtool at debian/rules. * Deleted CDBS from control file. * Added a patch to fix options.c. -- William Vera Fri, 15 Aug 2008 00:26:13 -0500 scrot (0.8-7) unstable; urgency=low * removed build dependency on xlibs-dev -- Laurence J. Lane Mon, 9 Jan 2006 00:10:21 -0500 scrot (0.8-6) unstable; urgency=low * corrected typos. Reported by Martin Pool. Thanks. Closes: #233835 * removed "(s)" from debian/copyright, lintian warning -- Laurence J. Lane Fri, 20 Feb 2004 13:12:04 -0500 scrot (0.8-5) unstable; urgency=low * removed -lfreetype and other extra linker flags * update to Standards-Version: 3.6.1.0 -- Laurence J. Lane Tue, 28 Oct 2003 20:26:39 -0500 scrot (0.8-4) unstable; urgency=low * src/Makefile*: replace @IMLIB2LIBS@ and @GIBLIBS@ with -lgiblib -- Laurence J. Lane Tue, 28 Oct 2003 19:31:37 -0500 scrot (0.8-3) unstable; urgency=low * src/Makefile.in: strip -ttf from scrot_LDADD, temp hack for mips* -- Laurence J. Lane Mon, 20 Oct 2003 23:13:50 -0400 scrot (0.8-2) unstable; urgency=low * shooting rubberbands at arm, mips and mipsel build failures -- Laurence J. Lane Sun, 19 Oct 2003 14:00:48 -0400 scrot (0.8-1) unstable; urgency=low * New upstream release * converted to CDBS -- Laurence J. Lane Fri, 26 Sep 2003 00:03:06 -0400 scrot (0.7-1) unstable; urgency=low * New upstream release -- Laurence J. Lane Fri, 28 Feb 2003 00:23:01 -0500 scrot (0.6-2) unstable; urgency=low * maintenance update: debhelper version, standards version, etc -- Laurence J. Lane Fri, 22 Nov 2002 04:00:16 -0500 scrot (0.6-1) unstable; urgency=low * New upstream release * debian/changelog: removed user emacs mode settings -- Laurence J. Lane Mon, 17 Dec 2001 09:27:48 -0500 scrot (0.5-1) unstable; urgency=low * new upstream release * updated package description, Closes: #93823 * changed section from x11 to graphics -- Laurence J. Lane Wed, 2 May 2001 21:40:26 -0400 scrot (0.3-2) unstable; urgency=low * Build-Depends typo corrected, closes: #77179 -- Laurence J. Lane Thu, 16 Nov 2000 10:27:21 -0500 scrot (0.3-1) unstable; urgency=low * Initial release -- Laurence J. Lane Mon, 30 Oct 2000 20:11:13 -0500 debian/patches/0000755000000000000000000000000011421412641010611 5ustar debian/patches/01_manpagefix.patch0000644000000000000000000000066311421412362014256 0ustar Author: William Vera Description: Character cleanup for UTF-8 compatibility. --- a/scrot.1 +++ b/scrot.1 @@ -87,7 +87,7 @@ \\n prints a newline (ignored when used in the filename) .fi .SH EXAMPLE -scrot '%Y-%m-%d_$wx$h.png' -e 'mv $f ~/shots/' +scrot '%Y\-%m\-%d_$wx$h.png' \-e 'mv $f ~/shots/' .br This would create a file called something like 2000-10-30_2560x1024.png and move it to your shots directory. debian/patches/003_descmanpage.patch0000644000000000000000000000046311421412367014473 0ustar Author: William Vera Description: Change the description on manpage. --- a/scrot.1 +++ b/scrot.1 @@ -1,6 +1,6 @@ .TH scrot 1 "Oct 26, 2000" .SH NAME -scrot - Screen capture using imlib2 +scrot - capture a screenshot using imlib2 .SH SYNOPSIS scrot [options] [file] .SH DESCRIPTION debian/patches/04-focused.patch0000644000000000000000000001504111421412372013505 0ustar Author: James Cameron Description: src/options.c (scrot_parse_option_array): add --focused option. src/main.c (scrot_get_geometry, scrot_nice_clip): new functions src/main.c (scrot_grab_focused): new function to grab currently --- a/src/options.h +++ b/src/options.h @@ -32,6 +32,7 @@ int delay; int countdown; int select; + int focused; int quality; int border; int multidisp; --- a/src/options.c +++ b/src/options.c @@ -44,13 +44,15 @@ static void scrot_parse_option_array(int argc, char **argv) { - static char stropts[] = "bcd:e:hmq:st:v+:"; + static char stropts[] = "bcd:e:hmq:st:uv+:"; static struct option lopts[] = { /* actions */ {"help", 0, 0, 'h'}, /* okay */ {"version", 0, 0, 'v'}, /* okay */ {"count", 0, 0, 'c'}, {"select", 0, 0, 's'}, + {"focused", 0, 0, 'u'}, + {"focussed", 0, 0, 'u'}, /* macquarie dictionary has both spellings */ {"border", 0, 0, 'b'}, {"multidisp", 0, 0, 'm'}, /* toggles */ @@ -95,6 +97,9 @@ case 's': opt.select = 1; break; + case 'u': + opt.focused = 1; + break; case '+': opt.debug_level = atoi(optarg); break; @@ -231,6 +236,7 @@ " and join them together.\n" " -s, --select interactively choose a window or rectangle\n" " with the mouse\n" + " -u, --focused use the currently focused window\n" " -t, --thumb NUM generate thumbnail too. NUM is the percentage\n" " of the original size for the thumbnail to be,\n" " or the geometry in percent, e.g. 50x60 or 80x20.\n" --- a/src/scrot.h +++ b/src/scrot.h @@ -72,7 +72,10 @@ char *filename_im, char *filename_thumb); void scrot_do_delay(void); Imlib_Image scrot_sel_and_grab_image(void); +Imlib_Image scrot_grab_focused(void); void scrot_sel_area(int *x, int *y, int *w, int *h); +void scrot_nice_clip(int *rx, int *ry, int *rw, int *rh); +int scrot_get_geometry(Window target, int *rx, int *ry, int *rw, int *rh); Window scrot_get_window(Display *display,Window window,int x,int y); Window scrot_get_client_window(Display * display, Window target); Window scrot_find_window_by_property(Display * display, const Window window, --- a/src/main.c +++ b/src/main.c @@ -48,7 +48,9 @@ } - if (opt.select) + if (opt.focused) + image = scrot_grab_focused(); + else if (opt.select) image = scrot_sel_and_grab_image(); else { scrot_do_delay(); @@ -171,6 +173,22 @@ } Imlib_Image +scrot_grab_focused(void) +{ + Imlib_Image im = NULL; + int rx = 0, ry = 0, rw = 0, rh = 0; + Window target = None; + int ignored; + + scrot_do_delay(); + XGetInputFocus(disp, &target, &ignored); + if (!scrot_get_geometry(target, &rx, &ry, &rw, &rh)) return NULL; + scrot_nice_clip(&rx, &ry, &rw, &rh); + im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1); + return im; +} + +Imlib_Image scrot_sel_and_grab_image(void) { Imlib_Image im = NULL; @@ -313,57 +331,10 @@ rh = 0 - rh; } } else { - Window child; - XWindowAttributes attr; - int stat; - /* else it's a window click */ - /* get geometry of window and use that */ - /* get windowmanager frame of window */ - if (target != root) { - unsigned int d, x; - int status; - - status = XGetGeometry(disp, target, &root, &x, &x, &d, &d, &d, &d); - if (status != 0) { - Window rt, *children, parent; - - for (;;) { - /* Find window manager frame. */ - status = XQueryTree(disp, target, &rt, &parent, &children, &d); - if (status && (children != None)) - XFree((char *) children); - if (!status || (parent == None) || (parent == rt)) - break; - target = parent; - } - /* Get client window. */ - if (!opt.border) - target = scrot_get_client_window(disp, target); - XRaiseWindow(disp, target); - } - } - stat = XGetWindowAttributes(disp, target, &attr); - if ((stat == False) || (attr.map_state != IsViewable)) - return NULL; - rw = attr.width; - rh = attr.height; - XTranslateCoordinates(disp, target, root, 0, 0, &rx, &ry, &child); - } - - /* clip rectangle nicely */ - if (rx < 0) { - rw += rx; - rx = 0; + if (!scrot_get_geometry(target, &rx, &ry, &rw, &rh)) return NULL; } - if (ry < 0) { - rh += ry; - ry = 0; - } - if ((rx + rw) > scr->width) - rw = scr->width - rx; - if ((ry + rh) > scr->height) - rh = scr->height - ry; + scrot_nice_clip(&rx, &ry, &rw, &rh); XBell(disp, 0); im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1); @@ -371,6 +342,72 @@ return im; } +/* clip rectangle nicely */ +void +scrot_nice_clip(int *rx, + int *ry, + int *rw, + int *rh) +{ + if (*rx < 0) { + *rw += *rx; + *rx = 0; + } + if (*ry < 0) { + *rh += *ry; + *ry = 0; + } + if ((*rx + *rw) > scr->width) + *rw = scr->width - *rx; + if ((*ry + *rh) > scr->height) + *rh = scr->height - *ry; +} + +/* get geometry of window and use that */ +int +scrot_get_geometry(Window target, + int *rx, + int *ry, + int *rw, + int *rh) +{ + Window child; + XWindowAttributes attr; + int stat; + + /* get windowmanager frame of window */ + if (target != root) { + unsigned int d, x; + int status; + + status = XGetGeometry(disp, target, &root, &x, &x, &d, &d, &d, &d); + if (status != 0) { + Window rt, *children, parent; + + for (;;) { + /* Find window manager frame. */ + status = XQueryTree(disp, target, &rt, &parent, &children, &d); + if (status && (children != None)) + XFree((char *) children); + if (!status || (parent == None) || (parent == rt)) + break; + target = parent; + } + /* Get client window. */ + if (!opt.border) + target = scrot_get_client_window(disp, target); + XRaiseWindow(disp, target); + } + } + stat = XGetWindowAttributes(disp, target, &attr); + if ((stat == False) || (attr.map_state != IsViewable)) + return 0; + *rw = attr.width; + *rh = attr.height; + XTranslateCoordinates(disp, target, root, 0, 0, rx, ry, &child); + return 1; +} + Window scrot_get_window(Display * display, Window window, debian/patches/series0000644000000000000000000000025611421412402012024 0ustar 01_manpagefix.patch 02_options.c.patch 003_descmanpage.patch 04-focused.patch 05-addfocusedmanpage.patch 06_manpagespace.patch 07_fix-formatstring.patch 08_fix-beeping.patch debian/patches/02_options.c.patch0000644000000000000000000000256611421412364014062 0ustar Author: William Vera Description: A little fix for wrong words. --- a/src/options.c +++ b/src/options.c @@ -229,7 +229,7 @@ " low quality means high compression.\n" " -m, --multidisp For multiple heads, grab shot from each\n" " and join them together.\n" - " -s, --select interactively choose a window or rectnagle\n" + " -s, --select interactively choose a window or rectangle\n" " with the mouse\n" " -t, --thumb NUM generate thumbnail too. NUM is the percentage\n" " of the original size for the thumbnail to be,\n" @@ -238,7 +238,7 @@ " Both the --exec and filename parameters can take format specifiers\n" " that are expanded by " PACKAGE " when encountered.\n" " There are two types of format specifier. Characters preceded by a '%%'\n" - " are interpretted by strftime(2). See man strftime for examples.\n" + " are interpreted by strftime(2). See man strftime for examples.\n" " These options may be used to refer to the current date and time.\n" " The second kind are internal to " PACKAGE " and are prefixed by '$'\n" debian/patches/08_fix-beeping.patch0000644000000000000000000000452711421412404014343 0ustar Author: Ibragimov Rinat Description: Fix missing option for beep prevention. --- a/scrot.1 +++ b/scrot.1 @@ -49,6 +49,9 @@ .B -t, --thumb NUM generate thumbnail too. NUM is the percentage of the original size for the thumbnail to be. +.TP 5 +.B -z, --silent +prevent beeping. .SH SPECIAL STRINGS Both the .B --exec --- a/src/main.c +++ b/src/main.c @@ -154,7 +154,7 @@ { Imlib_Image im; - XBell(disp, 0); + if (! opt.silent) XBell(disp, 0); im = gib_imlib_create_image_from_drawable(root, 0, 0, 0, scr->width, scr->height, 1); @@ -336,7 +336,7 @@ } scrot_nice_clip(&rx, &ry, &rw, &rh); - XBell(disp, 0); + if (! opt.silent) XBell(disp, 0); im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1); } return im; --- a/src/options.c +++ b/src/options.c @@ -44,7 +44,7 @@ static void scrot_parse_option_array(int argc, char **argv) { - static char stropts[] = "bcd:e:hmq:st:uv+:"; + static char stropts[] = "bcd:e:hmq:st:uv+:z"; static struct option lopts[] = { /* actions */ {"help", 0, 0, 'h'}, /* okay */ @@ -55,6 +55,7 @@ {"focussed", 0, 0, 'u'}, /* macquarie dictionary has both spellings */ {"border", 0, 0, 'b'}, {"multidisp", 0, 0, 'm'}, + {"silent", 0, 0, 'z'}, /* toggles */ {"thumb", 1, 0, 't'}, {"delay", 1, 0, 'd'}, @@ -109,6 +110,9 @@ case 't': options_parse_thumbnail(optarg); break; + case 'z': + opt.silent = 1; + break; default: break; } @@ -246,6 +250,7 @@ " -t, --thumb NUM generate thumbnail too. NUM is the percentage\n" " of the original size for the thumbnail to be,\n" " or the geometry in percent, e.g. 50x60 or 80x20.\n" + " -z, --silent Prevent beeping\n" "\n" " SPECIAL STRINGS\n" " Both the --exec and filename parameters can take format specifiers\n" " that are expanded by " PACKAGE " when encountered.\n" --- a/src/options.h +++ b/src/options.h @@ -35,6 +35,7 @@ int focused; int quality; int border; + int silent; int multidisp; int thumb; int thumb_width; debian/patches/05-addfocusedmanpage.patch0000644000000000000000000000063211421412374015512 0ustar Author: William Vera Description: Add a new option in the man page (focused option). --- a/scrot.1 +++ b/scrot.1 @@ -43,6 +43,9 @@ .B -s, --select Interactively select a window or rectangle with the mouse. .TP 5 +.B -u, --focused +Use the currently focused window. +.TP 5 .B -t, --thumb NUM generate thumbnail too. NUM is the percentage of the original size for the thumbnail to be. debian/patches/07_fix-formatstring.patch0000644000000000000000000000077611421412402015450 0ustar Author: George Danchev Description: Prevent arbitrary long file names --- a/src/options.c +++ b/src/options.c @@ -124,6 +124,12 @@ if (!opt.output_file) { opt.output_file = argv[optind++]; + + if ( strlen(opt.output_file) > 256 ) { + printf("output filename too long.\n"); + exit(EXIT_FAILURE); + } + if (opt.thumb) opt.thumb_file = name_thumbnail(opt.output_file); } debian/patches/06_manpagespace.patch0000644000000000000000000000057711421412377014602 0ustar Author: William Vera Description: Improve spacing in manual page. --- a/scrot.1 +++ b/scrot.1 @@ -61,7 +61,7 @@ These options may be used to refer to the current date and time. The second kind are internal to scrot and are prefixed by '$' The following specifiers are recognised: -.br +.PP .B $f image path/filename (ignored when used in the filename) .br debian/watch0000644000000000000000000000035411410204423010210 0ustar version=3 opts=uversionmangle=s/\.(tar.*|tgz|zip|gz|bz2)$//i,dversionmangle=s/[-.+~]?(cvs|svn|git|snapshot|pre|hg)(.*)$//i,pasv \ http://linuxbrit.co.uk/downloads/ (?:.*/)?scrot-?_?([\d+\.]+|\d+)\.(tar.*|tgz|zip|gz|bz2|) debian uupdate debian/rules0000755000000000000000000000035111421413413010237 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 #export DH_OPTIONS=-v %: dh $@ override_dh_auto_install: $(MAKE) install prefix=$(CURDIR)/debian/scrot/usr rm -rf $(CURDIR)/debian/scrot/usr/doc debian/control0000644000000000000000000000112711421412565010573 0ustar Source: scrot Section: graphics Priority: optional Maintainer: William Vera DM-Upload-Allowed: yes Standards-Version: 3.9.0 Build-Depends: libimlib2-dev, giblib-dev, debhelper (>=7.0.50~), autotools-dev, libtool Homepage: http://freshmeat.net/projects/scrot Package: scrot Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: command line screen capture utility scrot (SCReen shOT) is a simple commandline screen capture utility that uses imlib2 to grab and save images. Multiple image formats are supported through imlib2's dynamic saver modules. debian/compat0000644000000000000000000000000211410204423010353 0ustar 7 debian/source/0000755000000000000000000000000011412660206010464 5ustar debian/source/format0000644000000000000000000000001411421412360011666 0ustar 3.0 (quilt)