JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Do screenshots and add example script for it.
authorMarco Peereboom <marco@conformal.com>
Tue, 27 Jan 2009 07:36:49 +0000 (07:36 +0000)
committerMarco Peereboom <marco@conformal.com>
Tue, 27 Jan 2009 07:36:49 +0000 (07:36 +0000)
screenshot.sh [new file with mode: 0644]
scrotwm.c

diff --git a/screenshot.sh b/screenshot.sh
new file mode 100644 (file)
index 0000000..0536d9c
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+screenshot() {
+       case $1 in
+       full)
+               scrot -m
+               ;;
+       window)
+               sleep 1
+               scrot -s
+               ;;
+       *)
+               ;;
+       esac;
+}
+
+screenshot $1
index 6a73a7f..bc149b3 100644 (file)
--- a/scrotwm.c
+++ b/scrotwm.c
@@ -175,7 +175,7 @@ char                        *bar_fonts[] = {
 
 /* terminal + args */
 char                   *spawn_term[] = { "xterm", NULL };
-char                   *spawn_screenshot[] = { "scrot", NULL, NULL }; /* XXX get from conf */
+char                   *spawn_screenshot[] = { "screenshot.sh", NULL, NULL }; /* XXX get from conf */
 char                   *spawn_menu[] = { "dmenu_run", "-fn", NULL,
                            "-nb", NULL, "-nf", NULL, "-sb", NULL, "-sf", NULL, NULL };
 
@@ -1476,10 +1476,10 @@ screenshot(struct swm_region *r, union arg *args)
 
        switch (args->id) {
        case SWM_ARG_ID_SS_ALL:
-               spawn_screenshot[1] = "-m";
+               spawn_screenshot[1] = "full";
                break;
        case SWM_ARG_ID_SS_WINDOW:
-               spawn_screenshot[1] = "-s"; /* XXX doesn't work with scrot */
+               spawn_screenshot[1] = "window";
                break;
        default:
                return;