void-packages/srcpkgs/scrot/patches/08_fix-beeping.patch

91 lines
2.9 KiB
Diff
Raw Normal View History

Description: Fix missing option for beep prevention.
Author: Ibragimov Rinat <ibragimovrinat@mail.ru>
Last-Update: 2010-06-30
Index: scrot.1
===================================================================
--- scrot.1
+++ scrot.1
@@ -49,6 +49,9 @@ Use the currently focused window.
.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
Index: src/main.c
===================================================================
--- src/main.c
+++ src/main.c
@@ -154,7 +154,7 @@ scrot_grab_shot(void)
{
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_sel_and_grab_image(void)
}
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;
Index: src/options.c
===================================================================
--- src/options.c
+++ src/options.c
@@ -44,7 +44,7 @@ init_parse_options(int argc, char **argv
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 @@ scrot_parse_option_array(int argc, char
{"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 @@ scrot_parse_option_array(int argc, char
case 't':
options_parse_thumbnail(optarg);
break;
+ case 'z':
+ opt.silent = 1;
+ break;
default:
break;
}
@@ -246,6 +250,7 @@ show_usage(void)
" -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"
Index: src/options.h
===================================================================
--- src/options.h
+++ src/options.h
@@ -35,6 +35,7 @@ struct __scrotoptions
int focused;
int quality;
int border;
+ int silent;
int multidisp;
int thumb;
int thumb_width;