Publi

Script para realizar capturas de pantalla rápidas con las opciones que necesito

Tanto en mi uso personal, para este blog, documentación, etc; como en el trabajo, la realización de capturas de pantalla forma parte de mi día a día. Y con el paso de los años he ido puliendo mi script de captura de pantalla para poder realizar las tareas que necesito de la forma más rápida. Aunque, con el tiempo han ido saliendo programas como Shutter o Flameshot, en ocasiones he tenido problemas con ellas. Por un lado, necesito que sean muy rápidas, para realizar múltiples capturas sin esperas; y por otro que ocupen poca memoria y sean estables, para que no se quede el ordenador congelado y no sucedan cosas raras.

De todas formas, desde hace mucho tiempo mantengo mi propio script para realizar capturas de pantalla, ayudándome de pequeños programas libres disponibles en la red. Esta necesidad surgió cuando el propio software que venía con el entorno de escritorio (Gnome, KDE, XFCE…) eran muy lentos para realizar una captura de pantalla, o, si precisaba seleccionar un área de la pantalla tenía que acceder a un modo gráfico, elegir una opción y repetir la captura. Actualmente ya no es así, aunque esos programas siguen tardando bastante tiempo en iniciar y es algo que me incomoda. Y, bueno, la principal razón por la que me encanta el software libre es que podemos personalizar hasta el más mínimo detalle.

Quien realiza de verdad la captura

Las capturas, al principio las hacía con import (de ImageMagick), más tarde me pasé a scrot. Se portaba algo mejor, era más compatible con diversas configuraciones y recuerdo que en la época en que me cambié había un bug en ImageMagick que dificultaba un poco mi trabajo. Scrot también tenía algunos problemas y finalmente estoy utilizando maim. Éste último es parecido a scrot, pero sin muchos de los problemas que tiene, incluso permite utilizar slop para realizar la selección de la zona a capturar. Todo queda muy bien y es muy bonito.

Otras cosas que necesito cuando capturo pantalla

Me gusta tener varias teclas rápidas para realizar capturas de pantalla, ya sean de la pantalla completa o de una región. Además:

  • Quiero guardar la captura automáticamente en disco.
  • Quiero que ese archivo aparezca en mis documentos recientes. Para subirla directamente al blog.
  • Quiero poder editarla con algún programa sencillo de retoque. O realizar acciones rápidas sobre las capturas.
  • Me gusta tener notificaciones en pantalla para saber que todo está marchando bien.
  • Necesito poder llamar scripts automáticamente cuando se realicen las capturas (eventos).
  • Crear miniaturas automáticamente. Es algo de agradecer cuando vas con las prisas. Es algo que no se tarda nada, pero si ya las tienes hechas, mejor.
  • A ser posible, que se puedan configurar y me lo pueda llevar a otro ordenador con pocos recursos

Además, para hacer el script lo más completo posible vamos a utilizar técnicas explicadas en otras publicaciones anteriores:

Dependencias

Aunque intento que solo requiera lo básico, maim para capturar, ImageMagick para el tratamiento, notify-send para recibir notificaciones de escritorio y poco más. Al final, utiliza zenity para mostrar interfaces gráficos con opciones (aunque cuando la cosa se complica, tiro de python y pygtk), recents para insertar la captura en documentos recientes y zbar (aunque no es requerido) para procesar códigos QR si es que la captura tiene alguno.

Para el entorno gráfico me gustaría probar con yad para ver si cumple mis requerimientos. Aunque también podría eliminar la dependencia de zenity y tirar de python para todo lo relacionado con el entorno gráfico.

Cosas por hacer

Tengo varias ideas como hacer un periodo de espera de unos segundos tras la captura en el que podemos pulsar una tecla para acceder a opciones sobre esa captura o la opción para tener una configuración temporal, que dure unos minutos, por si queremos cambiar el tiempo de disparo gráficamente. Querría organizar un poco más el código, poner las funciones un poco más ordenadas y documentar muchas de las cosas que vemos en el código. También estoy abierto a sugerencias, así que, si veis algo que os gustaría tener en el sistema de capturas de pantalla, podéis dejarlo en los comentarios.

¡Manos a la obra!

Sin más dilación, pongo aquí el código fuente. Aunque podréis encontrar versiones actualizadas en Github.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
#!/bin/bash

# To-do
# Temporary configuration. Para delay y texto de comentarios del archivo. El archivo de configuracion temporal solo
# Estara vigente durante un tiempo (CONFIGURABLE)

# do_capture: separar en varias funciones
readonly VERSION="0.5"
readonly LOCKFILE="/tmp/gscreenshot_"$(whoami)"_"$(echo $DISPLAY | tr ':' '_')
readonly SCRIPTPATH="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
readonly DEBUG=1
LOCKFD=150
readonly MYPID="
$$"
readonly MYNAME="
$(basename "$0")"
MAIM_EXE=
CONVERT_EXE=
IDENTIFY_EXE=
MOGRIFY_EXE=
NOTIFY_EXE=
RECENTS_EXE=
ZENITY_EXE=
PYTHON_EXE=
PYTHON_GTK=
ZBAR_EXE=
declare -A DEFAULTCONFIG
DEFAULTCONFIG=(["
_default_FILENAME_PATTERN"]="%HOME%/Screenshot_%DATETIME%.png"
                             ["
_default_CAPTUREDIR"]="Captures"
                             ["
_default_DATETIME_FORMAT"]="%Y-%m-%d-%H%M%S"
                             ["
_default_DATE_FORMAT"]="%Y-%m-%d"
                             ["
_default_TIME_FORMAT"]="%H%M%S"
                             ["
_default_INCLUDE_CURSOR"]="no"
                             ["
_default_BORDER_WIDTH"]=2
                             ["
_default_BORDER_COLOR"]="1,0,0,0.8"
                             ["
_default_OTHER_OPTIONS"]=
                             ["
_default_DEFAULT_DELAY_SECS"]=
                             ["
_default_NOTIFY_GLYPH"]=
                             ["
_default_NOTIFY_BEOFORE"]=yes
                             ["
_default_NOTIFY_AFTER"]=yes
                             ["
_default_NOTIFY_BEFORE_DELAY"]=1000
                             ["
_default_NOTIFY_AFTER_DELAY"]=2000
                             )
readonly DEFAULTCONFIG
WRED='\033[0;31m'
WGREEN='\033[0;32m'
WMAGENTA='\033[0;35m'
WNC='\033[0m' # No Color

GREENOK="
${WGREEN}Ok${WNC}"
REDERR="
${WRED}Error${WNC}"

function util_filename()
{
  local FILE="
$1"
  FILE="
${FILE##*/}"
  [[ "
$2" ]] && echo "${FILE%.*}" || echo "${FILE%%.*}"
}

function util_fextension()
{
  local FILE="
$1"
  FILE="
${FILE##*/}"

  [[ "
$FILE" = *.* ]] && ( [[ "$2" = "1" ]] && echo "${FILE#*.}" || echo "${FILE##*.}")
}

function util_dirname()
{
  local PATH="
$1"

  [[ "
$PATH" = */* ]] && echo "${PATH%/*}"
}

function show_version() {
        echo "
Script para hacer capturas de pantalla. gscreenshot. Version $VERSION"
        echo "
Por Gaspar Fernández <gaspy@totaki.com>"
        echo "
https://gaspar.totaki.com/gscreenshot/"
}

function _debug() {
        if [ "
$DEBUG" ]; then
                echo -e "
${WMAGENTA}  DEBUG: $@${WNC}" >&2
        fi
}

function _error() {
        echo -e "
${WRED} ERROR: $@${WNC}" >&2
}

function extract_delimiters() {
        local ORIGINAL="
$1"
        local LEFT="
$2"
        local RIGHT="
$([ -n "$3" ] && echo "$3" || echo "$2")"

        RES=${ORIGINAL#*${LEFT}};
        RES=${RES%${RIGHT}*}

        echo "
$RES"
}

function extract_delimiters_c() {
        local ORIGINAL="
$1"
        local LEFT="
$2"
        local RIGHT="
$3"

        if [[ ${ORIGINAL:0:1} == "
$LEFT" ]]; then
                extract_delimiters "
$ORIGINAL" "$LEFT" "$RIGHT"
        else
                echo "
$ORIGINAL"
        fi
}

function help() {
        show_version

        echo
        echo "
Sintaxis:"
        echo "
  gscreenshot [opciones]"
        echo
        echo "
Las opciones son las siguientes:"
        echo "
--type=xx, -t xx : Indica el tipo de captura a realizar:"
        echo "
    screen   : Captura la pantalla completa."
        echo "
    window   : Captura la ventana activa."
        echo "
    user     : Crea una captura interactiva."
        echo "
--check, -c      : Comprueba las dependencias."
        echo "
--preview, -p    : Previsualiza la captura con el programa seleccionado"
        echo "
--help, -h       : Presenta esta pantalla de ayuda."
        echo "
--version, -v    : Versión del programa."
        echo
}

function panic() {
        local ERRSTR="
$2"
        local ERRCODE="
$1"

        echo "
Error: $ERRSTR ($ERRCODE)"
        # Errors:
        # From 1 to 10: initialization errors
        # From 10 to 50: capture errors
        # From 50 to 100: GUI errors
        # From 100 to infinity: user errors
        if [ $ERRCODE -gt 100 ]; then
                help
        elif [ $ERRCODE -gt 50 ]; then
                gui_error "
$ERRSTR"
        elif [ $ERRCODE -ge 10 ]; then
                launch_event "
ON_ERROR" "" "" "" "$ERRSTR"
        fi
        exit $ERRCODE
}

function gui_error() {
        $ZENITY_EXE --error --title="
Error en gscreenshot" --text "$@"
}

function gui_progress() {
        local TEXT="
$1"

        $ZENITY_EXE --progress --title="
gscreenshot" --text="$TEXT" --auto-close --time-remaining
}

function launch_event() {
        local EVENT_NAME="
$1"
        shift
        local EVENT="
$(get_setting "$EVENT_NAME")"
        if [ "
$EVENT" ]; then
                EVENT=$(generate_command "$EVENT" "$1" "$2" "$3" "$4")
                _debug $EVENT
                env sh -s <<< ${EVENT}
        fi
}

function check_dependencies() {
        MAIM_EXE=$(which maim)
        IDENTIFY_EXE=$(which identify)
        CONVERT_EXE=$(which convert)
        MOGRIFY_EXE=$(which mogrify)
        NOTIFY_EXE=$(which notify-send)
        RECENTS_EXE=$(which recents)
        ZENITY_EXE=$(which zenity)
        PYTHON_EXE=$(which python)
        ZBAR_EXE=$(which zbarimg)
        # If no input parameters panic mode when some program is not found
        local PANICMODE=false
        if [ -z "
$1" ]; then PANICMODE=true; fi

        if [ ! -r "
$MAIM_EXE" ]; then
                if $PANICMODE; then panic 5 "
No se cumplen las dependencias. Falta maim"; fi
        fi

        if [ ! -r "
$CONVERT_EXE" ]; then
                if $PANICMODE; then panic 5 "
No se cumplen las dependencias. Falta ImageMagick"; fi
        fi

        if [ ! -r "
$MOGRIFY_EXE" ]; then
                if $PANICMODE; then panic 5 "
No se cumplen las dependencias. Falta ImageMagick"; fi
        fi

        if [ ! -r "
$IDENTIFY_EXE" ]; then
                if $PANICMODE; then panic 5 "
No se cumplen las dependencias. Falta ImageMagick"; fi
        fi

        if [ ! -r "
$NOTIFY_EXE" ]; then
                if $PANICMODE; then panic 5 "
No se cumplen las dependencias. Falta notify_send"; fi
        fi

        if [ ! -r "
$RECENTS_EXE" ]; then
                # No panic with no recents
                # if "
$PANICMODE"; then panic 5 "No se cumplen las dependencias. Falta recents"; fi
                true
        fi

        if [ ! -r "
$ZENITY_EXE" ]; then
                if $PANICMODE; then panic 5 "
No se cumplen las dependencias. Falta zenity"; fi
        fi

        if [ ! -r "
$ZBAR_EXE" ]; then
                # No panic for zbar
                # if $PANICMODE; then panic 5 "
No se cumplen las dependencias. Falta zbar"; fi
                true
        fi

        if [ ! -r "
$PYTHON_EXE" ]; then
                # No panic with no python
                # if $PANICMODE; then panic 5 "
No se cumplen las dependencias. Falta python"; fi
                true
        else
                PYTHON_GTK=$($PYTHON_EXE <<EOF
try:
    import gi
    gi.require_version('Gtk', '3.0')
    from gi.repository import Gtk
    print('1')
except ImportError as er:
    print('ERROR')
EOF
                                         )
        fi
}

function check_sc_tpe() {
        local TYPE=$1
        local _VALID_TYPES=("
screen" "window" "user")

        if printf '%s\0' "
${_VALID_TYPES[@]}" | grep -Fqxz "$TYPE"; then
                echo "
ok"
                return 0;
        else
                return 1;
        fi
}

function lock() {
        local PID="
$(cat $LOCKFILE)"
        echo {LOCKFD}<>$LOCKFILE

        flock -n $LOCKFD
        local STATUS=$?
        if [ $STATUS = 0 ]; then
                # Escribimos nuestra PID
                echo $MYPID >&${LOCKFD}
                return 0
        else
                local PROCNAME="
$(cat /proc/$PID/comm 2>/dev/null)"
                if [ "
$PROCNAME" != "$MYNAME" ]; then
                        echo "
Error, el proceso ejecutado no coincide con el que debe"
                        exit 1
                fi
                local FROMTIME=$(awk -v ticks="$(getconf CLK_TCK)"
-v epoch="$(date +%s)" '
                        NR==1 { now=$1; next }
                        END { printf "%9.0f", epoch - (now-($20/ticks)) }'
/proc/uptime RS=')' /proc/$PID/stat | xargs -i date +"%d/%m/%Y %H:%M:%S" -d @{})
                echo "El proceso $PID ($PROCNAME) lleva abierto desde $FROMTIME"

                return 1
        fi
}

function exit_error() {
                echo "Ya hay una instancia en ejecución. Saliendo"
                exit 1
}

function read_ini_file() {
    shopt -p extglob &> /dev/null

    local CHANGE_EXTGLOB=$?
    if [ $CHANGE_EXTGLOB = 1 ]; then
        shopt -s extglob
    fi
        local CONFIG=
        declare -A CONFIG
    local FILE="$1"
    # Nombre por defecto cuando no hay sección
    local CURRENT_SECTION="_default"

    local ini="$(<$FILE)"

    # Quitamos los \r usados en la nueva línea en formato DOS
    ini=${ini//$'\r'/}
    # Convertimos a un array
    IFS=$'\n' && ini=(${ini})
    # Borra espacios al principio y al final (trim)
    ini=(${ini[*]/#+([[:space:]])/})
    ini=(${ini[*]/%+([[:space:]])/})
    # Borra comentarios, con ; y con #
    ini=(${ini[*]//;*/})
    ini=(${ini[*]//\#*/})

    for l in ${ini[*]}; do
        if [[ "$l" =~ ^\[(.*)\]$ ]]; then
            CURRENT_SECTION="${BASH_REMATCH[1]}"
        elif [[ "$l" =~ ^(.*)="(.*)" ]] || [[ "$l" =~ ^([^=]*)=(.*) ]]; then
            local KEY="${CURRENT_SECTION}_"${BASH_REMATCH[1]%%+([[:space:]])}
            local VALUE=${BASH_REMATCH[2]##+([[:space:]])}
            CONFIG[$KEY]="$VALUE"
        else
            false
        fi
    done

    if [ $CHANGE_EXTGLOB = 1 ]; then
        shopt -u extglob
    fi

        # CONFIG is now global
        local _CONFIG=$(declare -p CONFIG)
        # declare -p CONFIG >&2
        # Extracting only the interesting part (to avoid using eval)
        _CONFIG="$(extract_delimiters "$_CONFIG" "'")"
        # Undo escaping
        _CONFIG=${_CONFIG//\'\\'\'/\'}
        echo $_CONFIG
        #declare -p _CONFIG
        #readonly CONFIG

}

function get_config_file() {
        local locations=("$HOME/.gscreenshot" "$HOME/.local/etc/gscreenshot" "/etc/gscreenshot" ".gscreenshot")
        for loc in ${locations[@]}; do
                if [ -r "$loc" ]; then
                        echo "$loc"
                        return
                fi
        done
}

function read_config() {
        local CFGFILE="$(get_config_file)"
        if [ -z "$CFGFILE" ]; then
                return 1
        fi
        read_ini_file "$CFGFILE"
        return 0
}

function get_formatted_date() {
        local FORMAT="$1"
        local NOCACHE="$2"                  # If empty, use current DATE/TIME

        if [ -z "$NOCACHE" ] && [ ! "$_CACHED_DATE" ]; then
                _CACHED_DATE="$(date "+%s")"
        fi
        if [ -n "$FORMAT" ]; then
                [ -z "$NOCACHE" ] && date --date="@$_CACHED_DATE" +"$FORMAT" || date +"$FORMAT"
        fi
}

function get_setting() {
        local SETTING="$1"
        local NAMESPACE=$([ $2 ] && echo "$2" || echo "_default")
        local FILTER="$3"
        local VAL

        # _debug "$SETTING - ${MAINCONFIG[${NAMESPACE}_${SETTING}]} - ${DEFAULTCONFIG[${NAMESPACE}_${SETTING}]}"
        if [ "${MAINCONFIG[${NAMESPACE}_${SETTING}]}" ]; then
                VAL="$(extract_delimiters_c "${MAINCONFIG[${NAMESPACE}_${SETTING}]}" '"')"
        else
                VAL="${DEFAULTCONFIG[${NAMESPACE}_${SETTING}]}"
        fi

        case "$FILTER" in
                "number")
                        # If it's not a number, back to the default value
                        ! [[ "$VAL" =~ ^[0-9]+$ ]] && (
                                _error "La configuración $SETTING debe ser numérica. (Valor actual: $VAL)"
                                VAL="${DEFAULTCONFIG[${NAMESPACE}_${SETTING}]}"
                                )
                        ;;
                *)
                        ;;
        esac
        echo "$VAL"
}

function get_boolean() {
        local ARG="$1"

        case "${ARG,,}" in
                "yes"|"true"|"1"|"si"|"y"|"s")
                        echo true
                        ;;
                *)
                        ;;
        esac
}

function generate_filename() {
        local FILENAME="$1"
        local RECURSIVE="$2"                # When calling in a recursive way we may not want some replacements filled
        local REPLACEMENTS

        # TODO. We could make it global someway to improve speed
        declare -A REPLACEMENTS=(["HOME"]="$HOME"
                                                         ["CAPTUREDIR"]="$([[ "$RECURSIVE" =~ '/CAPTUREDIR' ]] || generate_filename "$(get_setting CAPTUREDIR)" "$RECURSIVE/CAPTUREDIR" )"
                                                         ["
THUMBNAILDIR"]="$([[ "$RECURSIVE" =~ '/THUMBNAILDIR' ]] || (generate_filename "$(get_setting THUMBNAILDIR)" "$RECURSIVE/THUMBNAILDIR") )"
                                                         ["
SCRIPTDIR"]="$SCRIPTPATH"
                                                         ["
DATETIME"]="$(get_formatted_date "$(get_setting DATETIME_FORMAT)")"
                                                         ["
DATE"]="$(get_formatted_date "$(get_setting DATE_FORMAT)")"
                                                         ["
TIME"]="$(get_formatted_date "$(get_setting TIME_FORMAT)")"
                                                        )

        for KEY in "
${!REPLACEMENTS[@]}"; do
                VALUE=${REPLACEMENTS["$KEY"]}
                FILENAME=${FILENAME//"%$KEY%"/"$VALUE"}
        done

        echo "
$FILENAME"
}

function generate_metadata() {
        local RAW="
$1"
        local RECURSIVE="
$2"                # When calling in a recursive way we may not want some replacements filled
        local MDREPS

        # TODO. We could make it global someway to improve speed
        declare -A MDREPS=(["
YEAR"]="$(get_formatted_date "%Y")"
                                             ["
USERNAME"]="$(whoami)"
                                             ["
DATETIME"]="$(get_formatted_date "$(get_setting DATETIME_FORMAT)")"
                                             ["
DATE"]="$(get_formatted_date "$(get_setting DATE_FORMAT)")"
                                             ["
TIME"]="$(get_formatted_date "$(get_setting TIME_FORMAT)")"
                                            )

        for KEY in "
${!MDREPS[@]}"; do
                VALUE=${MDREPS["$KEY"]}
                RAW=${RAW//"%$KEY%"/""$VALUE""}
        done

        echo "
$RAW"
}

function generate_command() {
        local RAW="
$1"
        local TYPE="
$2"
        local FILENAME="
$3"
        local DELAY="
$4"
        local MSG="
$5"

        local MDREPS

        declare -A MDREPS=(["
TYPE"]="$TYPE"
                                             ["
FILENAME"]="$FILENAME"
                                             ["
DELAY"]="$DELAY"
                                             ["
MSG"]="$MSG"
                                            )

        for KEY in "
${!MDREPS[@]}"; do
                VALUE=${MDREPS["$KEY"]}
                RAW=${RAW//"%$KEY%"/""$VALUE""}
        done

        echo "
$RAW"
}

function show_notification() {
        local TITLE="
$1"
        local CONTENT="
$2"
        local DELAY="
$3"
        local EXTRA="
$4"                        # More configuration for notifications
        local GLYPH="
$(get_setting NOTIFY_GLYPH)"
        local NOTIFY_ARGS=()

        if [ "
$GLYPH" ]; then
                NOTIFY_ARGS+=("
-i" "$(generate_filename "$GLYPH")")
        fi
        if [ "
$DELAY" ]; then
                NOTIFY_ARGS+=("
-t" "$DELAY")
        fi

        NOTIFY_ARGS+=("
$TITLE" "$CONTENT")
        _debug "
${NOTIFY_ARGS[@]}"
        $NOTIFY_EXE "
${NOTIFY_ARGS[@]}"
}

function do_capture() {
        local TYPE="
$1"

#       _debug ${MAINCONFIG[@}]
        local FILENAME="
$(generate_filename "$(get_setting FILENAME_PATTERN)")"
        local MAIM_ARGS=()

        case "
$TYPE" in
                "
window")
                        MAIM_ARGS+=("
-i $(xdotool getactivewindow)")
                        ;;
                "
user")
                        MAIM_ARGS+=("
-s")
                        local BORDERCOLOR="
$(get_setting BORDER_COLOR)"
                        local BORDERWIDTH="
$(get_setting BORDER_WIDTH)"
                        if [ "
$BORDERCOLOR" ]; then
                                MAIM_ARGS+=("
-c $BORDERCOLOR")
                        fi
                        if [ "
$BORDERWIDTH" ]; then
                                MAIM_ARGS+=("
-b $BORDERWIDTH")
                        fi
                        ;;
                "
screen")
                        ;;
                *)
                        ;;
        esac

        lock || show_notification "
Captura de pantalla" "El proceso de captura está bloqueado. Ya hay una captura en curso"

        if [ "
$(get_boolean "$(get_setting INCLUDE_CURSOR)")" ]; then
                MAIM_ARGS+=("
--showcursor")
        fi

        DELAY=$(get_setting DEFAULT_DELAY_SECS)
        if [ "
$DELAY" ]; then
                MAIM_ARGS+=("
-d $DELAY")
        fi
        #echo ${MAINCONFIG[@]}

        MAIM_ARGS+=($(get_setting OTHER_OPTIONS))
        MAIM_ARGS+=("
$FILENAME")

        [ "
$(get_boolean "$(get_setting NOTIFY_BEFORE)")" ] && show_notification "Captura de pantalla" "Seleccione el área a capturar" "$(get_setting NOTIFY_BEFORE_DELAY)"

        launch_event "
ON_BEFORE_CAPTURE" "$TYPE" "$FILENAME" "$DELAY"
        $MAIM_EXE "
${MAIM_ARGS[@]}"

        if [ "
$?" -ne "0" ];
    then
                [ "
$(get_boolean "$(get_setting NOTIFY_AFTER)")" ] && show_notification "Error" "Fallo al capturar" "$(get_setting NOTIFY_AFTER_DELAY)"
                panic 10 "
No se ha realizado la captura"
    else
                [ "
$(get_boolean "$(get_setting NOTIFY_AFTER)")" ] && show_notification "Muy bien" "Captura realizada con éxito" "$(get_setting NOTIFY_AFTER_DELAY)"
    fi

        launch_event "
ON_AFTER_CAPTURE" "$TYPE" "$FILENAME" "$DELAY"

        if [ ! -r "
$FILENAME" ]; then
                # No deberíamos NUNCA estar aquí. Pero, siempre pueden pasar cosas raras.
                panic 11 "
El archivo de captura no existe"
        fi
        local COMMENT="
$(get_setting APPEND_COMMENT)"
        if [ "
$COMMENT" ]; then
                COMMENT="
$(generate_metadata "$COMMENT")"
                $MOGRIFY_EXE -comment "
$COMMENT" "$FILENAME"
        fi

        [ "
$(get_boolean "$(get_setting USE_RECENTS)")" ] && recents -qa "$FILENAME"

        if [ "
$(get_boolean "$(get_setting MAKE_THUMBNAIL)")" ]; then
                local _MIN_WIDTH="
$(get_setting MIN_IMAGE_WIDTH "" number)"
                local _MIN_HEIGHT="
$(get_setting MIN_IMAGE_HEIGHT "" number)"
                if [ -n "
$(identify -format "%w %h" "$FILENAME" | awk "{ if (\$1 >$_MIN_WIDTH && \$2 > $_MIN_HEIGHT) print "true"}")" ]; then
                        local THUMB_FILE="
$(generate_filename "$(get_setting THUMBNAIL_PATTERN)")"
                        local DIRECTORY="
$(dirname "$THUMB_FILE")"
                        [ -d "
$DIRECTORY" ] || mkdir -p "$DIRECTORY"

                        local THCOMMENT="
$(get_setting APPEND_COMMENT_THUMBNAILS)"
                        if [ "
$THCOMMENT" ]; then
                                THCOMMENT="
$(generate_metadata "$THCOMMENT")"
                                convert "
$FILENAME" -comment "$THCOMMENT" -resize "$(get_setting THUMBNAIL_SIZE)" "$THUMB_FILE"
                        else
                                convert "
$FILENAME" -resize "$(get_setting THUMBNAIL_SIZE)" "$THUMB_FILE"
                        fi
                        launch_event "
ON_CREATE_THUMBNAIL" "$TYPE" "$THUMB_FILE" "$DELAY" "$FILENAME"
                fi
        fi

        local SUMMARYFILE="
$(generate_filename "$(get_setting SUMMARY_FILE)")"
        if [ "
$SUMMARYFILE" ]; then
                [ -d "
$(dirname "$SUMMARYFILE")" ] || mkdir -p "$SUMMARYFILE"
                touch "
$SUMMARYFILE"
                [ -r "
$SUMMARYFILE" ] || _error "Cannot access Summary File: $SUMMARYFILE"
                local LASTSHOTS="
$(head -n $(($(get_setting MAX_ENTRIES number)-1)) "$SUMMARYFILE")"
                echo -e "
$FILENAME\n$LASTSHOTS" > $SUMMARYFILE
        fi
}

function summary_file() {
        local _SUMMARYFILE="
$(get_setting SUMMARY_FILE)"
        [ "
$_SUMMARYFILE" ] || panic 56 "No hay fichero de registro de capturas"
        local SUMMARYFILE="
$(generate_filename "$_SUMMARYFILE")"
        echo "
$SUMMARYFILE"
}

function do_preview() {
        local SUMMARYFILE="
$(summary_file)"
        local EXTERNALPREVIEW="
$(get_setting PROGRAM_EXTERNAL_PREVIEW)"

        [ -n "
$EXTERNALPREVIEW" ] || panic 53 "No se ha especificado el programa para previsualizar"
        [ -r "
$SUMMARYFILE" ] || panic 51 "No se encuentra el índice de capturas"
        local LASTONE="
$(head -n1 "$SUMMARYFILE")"
        [ -r "
$LASTONE" ] || panic 52 "No se encuentra el fichero de captura <b>$LASTONE</b>"
        local PROGRAMNAME="
$(basename $EXTERNALPREVIEW)"
        [ "
$(which "$PROGRAMNAME")" ] || panic 54 "No se encuentra el programa <b>$PROGRAMNAME</b> para previsualizar archivos"
        _debug "
$(generate_command "$EXTERNALPREVIEW" "" "$LASTONE")"
        env sh -s <<< "
$(generate_command "$EXTERNALPREVIEW" "" "$LASTONE")"
}

function cache_store() {
        local FILENAME="
$1"
        local _CACHEDIR="
$(get_setting CACHE_DIRECTORY)"
        local AMWIDTH="
$(get_setting AM_THUMBNAIL_WIDTH "" number)"
        local AMHEIGHT="
$(get_setting AM_THUMBNAIL_HEIGHT "" number)"
        [ "
$_CACHEDIR" ] || panic 55 "No se ha especificado el directorio de caché"
        local CACHEDIR="
$(generate_filename "$_CACHEDIR")"
        _debug $CACHEDIR
        [ -d "
$CACHEDIR" ] || mkdir p "$CACHEDIR"
        [ -r "
$FILENAME" ] || return
        local IMAGEFILENAME="
$(util_filename "$FILENAME" t)"
        local IMAGEFILEEXT="
$(util_fextension "$FILENAME")"
        local IMAGEDIR="
$(util_dirname "$FILENAME")"
        local CACHEFILE="
${CACHEDIR}/thumb_${IMAGEFILENAME}.jpg"
        _debug $AMWIDTH x $AMHEIGHT
        if [ -r "
$CACHEFILE" ] &&
                     [ -n "
$(identify -format "%w %h" "$CACHEFILE" | awk "{ if (\$1 <=${AMWIDTH} && \$2 <= ${AMHEIGHT}) print "true"}")" ]; then
                # Cache file is already created and it looks good
                echo $CACHEFILE
                return
        fi
        convert "
$FILENAME" -resize ${AMWIDTH}x${AMHEIGHT}\> "$CACHEFILE"

        echo $CACHEFILE
}

function join_by() {
        local IFS="
$1";
        shift;
        echo "
$*";
}

function do_qr_code() {
        local FILENAME="
$1"
        local QRDELETE="
$(get_boolean "$(get_setting QR_DELETE_IMAGE)")"
        local QRCONTENT
        QRCONTENT="
$($ZBAR_EXE "$FILENAME")"
        local STATUS=$?

        if [ $STATUS -eq 0 ]; then
                $ZENITY_EXE --info --title="
gscreenshot" --text="$QRCONTENT"
                [ "
$QRDELETE" ] && rm "$FILENAME"
        else
                $ZENITY_EXE --error --title="
gscreenshot" --text="No se encontró el código QR"
        fi
}

function do_image_menu() {
        local IMAGEFILE="
$1"
        local AMWIDTH="
$(get_setting AM_WIDTH "" number)"
        local AMHEIGHT="
$(get_setting AM_HEIGHT "" number)"
        [ "
$PYTHON_GTK" ] || panic 57 "No se ha instalado Python o PyGTK"

        _OPTIONS=("
quick-edit=Edición rápida"
                         "
edit=Editar")
        _OPTIONS+=("
qr-code=Buscar QR-code")
        _OPTIONS+=("
exit=Salir")

        OPTIONS="
$(join_by $'\n' "${_OPTIONS[@]}" | sed '{:a;N;s/\n/\\n/g;t a}')"

        local ACTION="
$($PYTHON_EXE <<EOF
# -*- coding: utf-8 -*-
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk, GdkPixbuf

class PyMenu(Gtk.Window):
    def __init__(self, imageFile, width, height, options):
        super(PyMenu, self).__init__()
        self.zoom=1

        self.set_size_request(width, height)
        self.set_position(Gtk.WindowPosition.CENTER)
        self.connect("destroy", Gtk.main_quit)
        self.set_title("Vista previa de imagen")

        grid = Gtk.Grid();
        grid.set_column_spacing(20)
        grid.set_row_spacing(20)

        label = Gtk.Label(label="Texto introductorio")
        self.box = Gtk.ScrolledWindow()
        self.box.set_policy(Gtk.PolicyType.AUTOMATIC,
                       Gtk.PolicyType.AUTOMATIC)

        self.pixbuf = GdkPixbuf.Pixbuf.new_from_file(imageFile)
        self.image = Gtk.Image()
        self.image.set_from_pixbuf(self.pixbuf)
        self.connect("size-allocate", self.on_size_allocate)
        self.box.add(self.image)
        self.box.set_hexpand(True)
        self.box.set_vexpand(True)

        buttonsData=options.split('\n')
        buttonbox = Gtk.Box(spacing=6)

        for i in buttonsData:
            btpart=i.partition('=')
            btn=Gtk.Button(btpart[2].strip())
            btn.userdata=btpart[0].strip()
            btn.connect("clicked", self.on_button_clicked)
            buttonbox.pack_start(btn, True, True, 0)

        grid.add(label)
        grid.attach(self.box,0,1,1,1)
        grid.attach(buttonbox, 0, 2, 1, 1)

        self.add(grid)
        self.show_all()

        self.image.set_size_request(self.box.get_allocation().width, height=self.box.get_allocation().height)

    def on_size_allocate(self, obj, rect):
        k_pixbuf = float(self.pixbuf.props.height) / self.pixbuf.props.width
        # rect = self.box.get_allocation()
        k_rect = float(rect.height) / rect.width

        if k_pixbuf < k_rect:
              newWidth = rect.width
              newHeight = int(newWidth * k_pixbuf)
        else:
            newHeight = rect.height
            newWidth = int(newHeight / k_pixbuf)

        base_pixbuf = self.image.get_pixbuf()
        if base_pixbuf.props.height == newHeight and base_pixbuf.props.width == newWidth:
            return

        base_pixbuf = self.pixbuf.scale_simple(
            newWidth*self.zoom,
            newHeight*self.zoom,
            GdkPixbuf.InterpType.BILINEAR
        )

        self.image.set_from_pixbuf(base_pixbuf)

    def on_button_clicked(self, widget):
        print(widget.userdata)
        self.destroy()

PyMenu("${IMAGEFILE}",${AMWIDTH},${AMHEIGHT}, "${OPTIONS}")
Gtk.main()
EOF

        )"

        case "
$ACTION" in
                "
quick-edit")
                        do_invoke "
PROGRAM_QUICK_EDIT" "$ACTION" "$IMAGEFILE"
                        ;;
                "
edit")
                        do_invoke "
PROGRAM_EDIT" "$ACTION" "$IMAGEFILE"
                        ;;
                "
qr-code")
                        do_qr_code "
$IMAGEFILE"
                        ;;
                *)
                        ;;
        esac

}

function do_invoke() {
        local INVOCATION="
$1"
        local ACTION="
$2"
        local IMAGEFILE="
$3"

        local PROGRAM="
$(get_setting "$INVOCATION")"

        [ -n "
$PROGRAM" ] || panic 58 "No se ha especificado el programa externo para $ACTION"
        local PROGRAMNAME="
$(basename $PROGRAM)"
        [ "
$(which "$PROGRAMNAME")" ] || panic 59 "No se encuentra el programa <b>$PROGRAMNAME</b> para $ACTION"

        _debug "
$(generate_command "$PROGRAM" " " "$IMAGEFILE")"
        env sh -s <<< "
$(generate_command "$PROGRAM" " " "$IMAGEFILE")"

}

function do_actions() {
        local SUMMARYFILE="
$(summary_file)"
        local AMWIDTH="
$(get_setting AM_WIDTH "" number)"
        local AMHEIGHT="
$(get_setting AM_HEIGHT "" number)"

        local EXIT=
        while [ ! $EXIT ]; do
                IFS=$'\n\r' &&  local FILES=($(cat "$SUMMARYFILE")) && unset IFS
                local THUMBNAILS=()

                for (( fi=0; fi < ${#FILES[@]}; fi++)); do
                        local FILE=${FILES[fi]}
                        local THUMB=("
$(cache_store "$FILE")")
                        local RESOL
                        local FSIZE
                        _debug "
AKA --- $THUMB"

                        [ "
$THUMB" ] &&
                                RESOL="
$(identify -format "%wx%h" "$FILE")" &&
                                FSIZE="
$(numfmt --to=iec-i --suffix=B --format="%.3f" "$(stat -c%s "$FILE")")" &&
                                IFS=$'\n'&& THUMBNAILS+=("
$(echo -e "${THUMB}\t${FILE}\t${RESOL}\t${FSIZE}")") && unset IFS

                        echo $(((fi+1)*100/${#FILES[@]}))
                done > >(gui_progress "
Creando miniaturas...")

                local OPTIONS=()
                IFS=$'\n' && for THF in ${THUMBNAILS[@]};do
                        IFS=$'\t' && for t in $THF; do
                                local THUMB="
${t[0]}"
                                local FILE="
${t[1]}"
                                local DIMS="
${t[2]}"
                                local SIZE="
${t[3]}"
                                OPTIONS+=("
$THUMB")
                                OPTIONS+=("
$FILE")
                                OPTIONS+=("
$DIMS")
                                OPTIONS+=("
$SIZE")
                        done
                done
                OUTPUT=$($ZENITY_EXE --list --width $AMWIDTH --height $AMHEIGHT \
                                        --text "
Elige uno" \
                                        --separator=$'\t' \
                                        --imagelist \
                                        --print-column 2 \
                                        --ok-label="
Vista previa" \
                                        --cancel-label="
Salir" \
                                        --column "
Vista previa" \
                                        --column "
Nombre del archivo" \
                                        --column "
Dimensiones" \
                                        --column "
Tamaño" ${OPTIONS[@]})
                local STATUS=$?
                if [ "
$STATUS" -eq 0 ]; then
                        # Vista previa y mas
                        do_image_menu "
$OUTPUT"
                else
                        EXIT=1
                fi
        done
        # (
        #       for (( i=0; i<100; i++ )); do
        #               sleep 0.1
        #               echo $i
        #       done
        # ) | gui_progress "
Creando miniaturas..."
}

function cond_write() {
        local COND="
$1"
        local WRITEOK="
$2"
        local WRITERR="
$3"

        if [ "
$COND" ]; then
                echo -en "
$WRITEOK";
        else
                echo -en "
$WRITERR";
        fi
}

function do_dependency_check() {
        show_version
        echo
        check_dependencies 1
        echo -en "
Maim: "
        cond_write "
$([ -n "$MAIM_EXE" ] && echo 1)" "[${GREENOK}]\n" "[${REDERR}]\n"
        echo -en "
Convert: "
        cond_write "
$([ -n "$CONVERT_EXE" ] && echo 1)" "[${GREENOK}]\n" "[${REDERR}]\n"
        echo -en "
Identify: "
        cond_write "
$([ -n "$IDENTIFY_EXE" ] && echo 1)" "[${GREENOK}]\n" "[${REDERR}]\n"
        echo -en "
Mogrify: "
        cond_write "
$([ -n "$MOGRIFY_EXE" ] && echo 1)" "[${GREENOK}]\n" "[${REDERR}]\n"
        echo -en "
Notify-send: "
        cond_write "
$([ -n "$NOTIFY_EXE" ] && echo 1)" "[${GREENOK}]\n" "[${REDERR}]\n"
        echo -en "
Recents (no obligatorio): "
        cond_write "
$([ -n "$RECENTS_EXE" ] && echo 1)" "[${GREENOK}]\n" "[${REDERR}]\n"
        echo -en "
Zenity: "
        cond_write "
$([ -n "$ZENITY_EXE" ] && echo 1)" "[${GREENOK}]\n" "[${REDERR}]\n"
        echo -en "
Zbar: "
        cond_write "
$([ -n "$ZBAR_EXE" ] && echo 1)" "[${GREENOK}]\n" "[${REDERR}]\n"
        echo -en "
Python: "
        cond_write "
$([ -n "$PYTHON_EXE" ] && echo 1)" "[${GREENOK}]\n" "[${REDERR}]\n"
        echo -en "
Gtk for Python: "
        cond_write "
$([ -n "$PYTHON_GTK" ] && echo 1)" "[${GREENOK}]\n" "[${REDERR}]\n"
}

ARGS=$(getopt -q -o "t:aphvc" -l "type:,actions,preview,version,help,check" -n "args" -- "$@");
if [ $? -ne 0 ];
then
    echo "
Ha habido un error al procesar los argumentos."
    exit 1
fi

eval set -- "
$ARGS";

JOB=
TYPE=

while [ $# -gt 0 ]; do
        case "
$1" in
                -t|--type)
                        if [ -z "
$(check_sc_tpe $2)" ]; then
                                panic 1 "
Tipo de captura incorrecto. Vea la ayuda"
                        fi
                        JOB="
capture"
                        TYPE="
$2"
                        shift;
                        ;;
                -p|--preview)
                        JOB="
preview"
                        shift;
                        ;;
                -a|--actions)
                        JOB="
actions"
                        shift;
                        ;;
                -v|--version)
                        show_version
                        exit 0
                        ;;
                -c|--check)
                        do_dependency_check
                        exit 0
                        ;;
                -h|--help)
                        help
                        exit 0
                        ;;
                --)
                        shift;
                        break;
                        ;;
        esac
        shift
done

check_dependencies

if [ "
$JOB" ]; then
        if ! _MAINCONFIG=$(read_config); then
                echo "
Puede crear un fichero de configuración para establecer algunos parámetros comunes."
                echo
        fi
        declare -A MAINCONFIG="
${_MAINCONFIG[@]}"
        # echo ${MAINCONFIG[@]}
fi

case "
$JOB" in
        "
capture")
                do_capture "
$TYPE"
                ;;
        "
preview")
                do_preview
                ;;
        "
actions")
                do_actions
                ;;
        *)
                panic 2 "
Trabajo desconocido"
                ;;
esac

Configuración

El script require configuración. Y, para ello, he acudido a archivos tipo INI, y así evitar que alguien pueda tocar parte de la funcionalidad del script insertando código en el archivo de configuración (solo en los eventos podríamos). Normalmente, tocando solo el fichero de configuración podremos personalizar bastante el comportamiento del script. Dicho archivo podemos situarlo en (por orden de preferencia):

  • $HOME/.gscreenshot
  • $HOME/.local/etc/gscreenshot
  • /etc/gscreenshot
  • ./.gscreenshot

Uso

Aunque podemos utilizar varias opciones más, y el programa dispone de una pequeña ayuda para ello, las opciones más básicas son:

Verificar dependencias

Con esto, podemos saber si el programa va a funcionar bien, se comprueba que existan los programas que requiere para su correcto funcionamiento. Algunos serán requeridos y otros no.

gscreenshot -c
Script para hacer capturas de pantalla. gscreenshot. Version 0.5
Por Gaspar Fernández
https://gaspar.totaki.com/gscreenshot/
Maim: [Ok]
Convert: [Ok]
Identify: [Ok]
Mogrify: [Ok]
Notify-send: [Ok]
Recents (no obligatorio): [Ok]
Zenity: [Ok]
Zbar: [Ok]
Python: [Ok]
Gtk for Python: [Ok]

Captura de pantalla

Lo más importante, capturar la pantalla. Las capturas pueden ser de tres tipos:

  • screen: Captura la pantalla entera.
  • window: Captura la ventana actual.
  • user: Permite al usuario seleccionar la región a capturar.
gscreenshot -t [tipo]

Vista previa con programa externo

Previsualiza la última captura de pantalla con un programa externo. Yo uso geeqie para estas cosas que además me permite navegar un poco por las demás imágenes.

gscreenshot -p

Trabajo de forma gráfica con las capturas

Esto nos permite ver miniaturas de las capturas y realizar acciones sobre ellas como editarlas con diversos programas, o mirar si tienen un código QR y analizar su contenido. Podremos añadir más opciones como subir la captura a un servidor externo o cualquier cosa que se nos ocurra hacer con ellas. Para este menú se crean más miniaturas (más pequeñas que las primeras que se crean con el programa, para que encajen, aunque en el futuro se podrá utilizar otro sistema para crear el menú). Las miniaturas generadas aquí se guardarán en un directorio de caché para evitar generarlas todo el rato cada vez que se muestra el menú.

gscreenshot -a

Foto principal: unsplash-logoIgor Miske

También podría interesarte....

There are 72 comments left Ir a comentario

  1. Eleazar Ramos Cortés /
    Usando Google Chrome Google Chrome 66.0.3359.139 en Windows Windows NT

    Buen curro ojalá lo hubiera tenido para los trabajos del grado medio de informática 😀

    1. Gaspar Fernández / Post Author
      Usando Mozilla Firefox Mozilla Firefox 59.0 en Ubuntu Linux Ubuntu Linux

      Gracias! Esperemos que los futuros estudiantes lo tengan a mano 🙂 Y, aunque no sea por las capturas de pantalla, que son lo de menos, al final nos vale como chuleta de PyGTK y algunas cosas más 🙂

    2. Seguidores De Tik Tok /
      Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

      Esta excelente. Mira este post sobre como ganar seguidores que te va a interesar http://www.opensource.platon.org/forum/projects/viewtopic.php?p=12573847#12573847

  2. Ordercustomessay /
    Usando Google Chrome Google Chrome 24.0.1312.70 en Windows Windows 8

    Gracias Jose Ignacio.

  3. victorhck /
    Usando Mozilla Firefox Mozilla Firefox 51.0 en Linux Linux

    interesante… gracias por compartirlo!
    De momento me sigo quedando con Spectacle, y he descubierto recientemente Flameshot, que para las ocasiones en que lo uso me es suficiente… sí me gustaría que pudiese subirse rápidamente a servicios «paste»…

    Saludos! keep on rockin’

    1. Gaspar Fernández / Post Author
      Usando Mozilla Firefox Mozilla Firefox 59.0 en Ubuntu Linux Ubuntu Linux

      Hola Victorhck!
      En mi caso, Spectacle me va un poco lento cuando necesito hacer muchas capturas y Flameshot me da problemas, creo que es por la tarjeta nvidia y las dos pantallas, hacen que se detecte un poco raro.

      Por lo de subir a servicios paste, en Spectacle puedes configurar Exportar a otra aplicación, y que esa aplicación sea un pequeño script que suba a algún servicio 🙂 Habría que darle una vuelta.

  4. ozymandias32 /
    Usando Google Chrome Google Chrome 72.0.3626.109 en Windows Windows NT

    Hola, muy interesantes todas las entradas de la pagina, estoy muy interesado en aprender bash y batch, no tendrás algún documento o manual para echarles una estudiada ?

  5. design a custom wordpress plugin /
    Usando Google Chrome Google Chrome 116.0.0.0 en Windows Windows NT

    Keep up the good work, and feel free to share any tips or insights you have on optimizing screenshot workflows with your script.

  6. 토토사이트 /
    Usando Google Chrome Google Chrome 117.0.0.0 en Windows Windows NT

    Excellent works. Continue to write such information on your blog.Your blog left a deep impression on me. I am sure they will benefit from this website.토토사이트

  7. Wordle answer today /
    Usando Google Chrome Google Chrome 118.0.0.0 en Windows Windows NT

    Have you become mired in a Wordle puzzle? Our helpful selection of Wordle hints can assist you in obtaining the answer today.

  8. 메이저사이트 /
    Usando Google Chrome Google Chrome 118.0.0.0 en Windows Windows NT

    It’s such a nice piece of writing that I can get rid of a hard day. It’s touching and I feel good to look back on today. It really cheers me up . 메이저사이트

  9. 토토사이트추천 /
    Usando Google Chrome Google Chrome 119.0.0.0 en Windows Windows NT

    This is an awesome blog. It helped me alot. Thanks for the information. 토토사이트추천

  10. jeffreestar /
    Usando Google Chrome Google Chrome 119.0.0.0 en Windows Windows NT

    Este script es una excelente herramienta para realizar capturas de pantalla rápidamente y con las opciones tiki taka toe que necesitas.

  11. Dover Handyman /
    Usando Google Chrome Google Chrome 119.0.0.0 en Windows Windows NT

    Impressive dedication to optimizing your screenshot process! I agree, customization is a key advantage of free software. I’ve found maim to be reliable as well.

  12. jsimitseo /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    The sheer size and selection of these web slots are mind-blowing. Great job. สล็อตค่ายใหญ่

  13. Business Listings /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    It’s a big help for me since I take screenshots a lot too. It’s good that I read this. Thanks for sharing, keep posting like this.

  14. WilliamSEO /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    In the wake of examining your article I was shocked. I understand that you clear up it extraordinarily well. In addition, I assume that diverse perusers will in like manner experience how I feel in the wake of scrutinizing your article. daftar pasar123

  15. WilliamSEO /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    This is likewise a decent post which I truly appreciated perusing. It isn’t each day that I have the likelihood to see something like this.. 토토사이트

  16. jsimitseo /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    Let’s brainstorm ideas on how to extend the lifespan of slots through maintenance or modifications. เว็บสล็อต

  17. jsimitseo /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    I likewise composed an article on a comparative subject will discover it at compose what you think. รวมสล็อตทุกค่ายในเว็บเดียว

  18. jsimitseo /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    I read this article. I think You put a lot of effort to make this article. I like your work. เกมสล็อตโรม่า

  19. jsimitseo /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    Astounding read, Positive webpage, where did u think of the data on this posting?I have perused a couple of the articles on your site now, and I extremely like your style. You rock and please keep up the compelling work. เกมไพ่ป๊อกเด้ง

  20. jsimitseo /
    Usando Google Chrome Google Chrome 120.0.0.0 en Windows Windows NT

    Magnificent dispatch! I am to be sure getting well-suited to over this data, is genuinely neighborly my amigo. In like manner awesome blog here among a significant number of the exorbitant data you gain. Hold up the advantageous procedure you are doing here. 블로그

  21. Rank Xone /
    Usando Google Chrome Google Chrome 121.0.0.0 en Windows Windows NT

    Online casinos are a game-changer. The convenience of playing from home without sacrificing the excitement of a traditional casino is unbeatable. 우리카지노

  22. jsimitseo /
    Usando Google Chrome Google Chrome 121.0.0.0 en Windows Windows NT

    Magnificent dispatch! I am to be sure getting well-suited to over this data, is genuinely neighborly my amigo. In like manner awesome blog here among a significant number of the exorbitant data you gain. Hold up the advantageous procedure you are doing here. concierge doctor naples

  23. Fool Me Once S01 Abby Walker Jacket /
    Usando Google Chrome Google Chrome 121.0.0.0 en Windows Windows NT

    I found this post very exciting. I am also sending it to my friends to enjoy this blog.

  24. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    My floors shine bright thanks to levigatura parquet in Brescia. levigatura parquet brescia

  25. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    I’m impressed by the professionalism of Brescia’s levigatura parquet experts. levigatura parquet reggio emilia

  26. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Ceramiche are the perfect blend of form and function. ceramiche Sassuolo

  27. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Ceramiche make any space feel more inviting and welcoming. auto noleggio Modena

  28. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Incredible post I should state and much obliged for the data. Instruction is unquestionably a sticky subject. Be that as it may, is still among the main themes of our opportunity. I value your post and anticipate more. affitto immobile gorizia

  29. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Goodness! Such an astounding and supportive post this is. I outrageously cherish it. It’s so great thus amazing. I am simply flabbergasted. I trust that you keep on doing your work like this later on moreover. studio grafico cervignano

  30. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    The virtual atmosphere in online casinos is so immersive. It’s like stepping into a different world filled with endless possibilities and potential wins. 프리카지노

  31. https //ij.start.cannon /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Discover easy setup for your Canon printer at https //ij.start.cannon. Simplify printer installation and troubleshooting with step-by-step guides. For additional support, visit our site or connect with our technical experts via live chat.

  32. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    I’m always amazed by the depth of flavor in ethnic meals. EthnicMeal ethnic foods

  33. WilliamSEO /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    I always leave Nirvana Singapore with a sense of inner peace and clarity. nirvana memorial garden

  34. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Here at this site extremely the critical material accumulation so everyone can appreciate a great deal. จำนำรถจอด

  35. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    It ought to be noticed that while requesting papers available to be purchased at paper composing administration, you can get unkind state of mind. In the event that you feel that the authority is endeavoring to cheat you, don’t purchase research project from it. 레플리카사이트

  36. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Goodness! Such an astounding and supportive post this is. I outrageously cherish it. It’s so great thus amazing. I am simply flabbergasted. I trust that you keep on doing your work like this later on moreover. 레플리카

  37. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    I like review goals which understand the cost of passing on the amazing strong asset futile out of pocket. I truly worshiped examining your posting. Grateful to you! 카지노api

  38. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Slot deposit 5000 sounds like a great deal to get started with some serious gaming fun! slot deposit 5000

  39. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    It ought to be noticed that while requesting papers available to be purchased at paper composing administration, you can get unkind state of mind. In the event that you feel that the authority is endeavoring to cheat you, don’t purchase research project from it. casa Londra

  40. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    I feel extremely cheerful to have seen your site page and anticipate such a large number of all the more engaging circumstances perusing here. Much appreciated yet again for every one of the points of interest. auto noleggio Modena

  41. WilliamSEO /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    I like review sites which grasp the cost of conveying the fantastic helpful asset for nothing out of pocket. I genuinely revered perusing your posting. Much obliged to you! womens funny underwear

  42. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    I am searching for and I want to post a remark that «The substance of your post is magnificent» Great work! skips Brisbane

  43. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Goodness! Such an astounding and supportive post this is. I outrageously cherish it. It’s so great thus amazing. I am simply flabbergasted. I trust that you keep on doing your work like this later on moreover. tutoring Penrith

  44. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Such a particularly huge article. To an incredible degree beguiling to look at this article.I should need to thank you for the endeavors you had made for making this shocking article. gastroenterologist north shore

  45. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Super site! I am Loving it!! Will return again, Im taking your sustenance moreover, Thanks. ceramiche Sassuolo

  46. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Extremely pleasant and fascinating post. I was searching for this sort of data and appreciated perusing this one. Continue posting. Much obliged for sharing. auto noleggio Modena

  47. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    stunning, glorious, I was thinking about how to cure skin disturbance routinely. likewise, discovered your site by google, took in a ton, now i’m to some degree clear. I’ve bookmark your site and also join rss. keep us resuscitated. casa Londra

  48. Rank Xone /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Excited to meet fellow fashion enthusiasts and learn together in this part-time course! Fashion Design Diploma Courses

  49. WilliamSEO /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    It is ideal time to make a few arrangements for the future and the time has come to be upbeat. I’ve perused this post and on the off chance that I would I be able to want to recommend you few fascinating things or tips. Maybe you could compose next articles alluding to this article. I need to peruse more things about it! naughty gifts for women funny

  50. WilliamSEO /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    I should state just that its magnificent! The blog is instructive and dependably create astonishing things. demo mahjong ways

  51. WilliamSEO /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Goodness! Such an astounding and supportive post this is. I outrageously cherish it. It’s so great thus amazing. I am simply flabbergasted. I trust that you keep on doing your work like this later on moreover. 西屯婦產科

  52. WilliamSEO /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    It has completely risen to crown Singapore’s southern shores and without a doubt set her on the worldwide guide of private historic points. Regardless I scored the a bigger number of focuses than I ever have in a season for GS. I figure you would be unable to discover someone with a similar consistency I have had throughout the years so I am content with that. Web Design London

  53. WilliamSEO /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    It is ideal time to make a few arrangements for the future and the time has come to be upbeat. I’ve perused this post and on the off chance that I would I be able to want to recommend you few fascinating things or tips. Maybe you could compose next articles alluding to this article. I need to peruse more things about it! Homes for sale

  54. WilliamSEO /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can’t wait to read lots of your posts. eagle idaho real estate

  55. WilliamSEO /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    To a great degree lovely and interesting post. I was scanning for this kind of information and savored the experience of examining this one. houses for sale in middleton idaho

  56. WilliamSEO /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Extremely inspired! Everything is extremely open and clear illumination of issues. It contains really certainties. Your site is extremely important. Much obliged for sharing. realtor star idaho

  57. WilliamSEO /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    The city is renowned for its music scene, with a plethora of live music venues catering to various tastes, from indie to classical. Additionally, Glasgow hosts numerous festivals throughout the year, celebrating everything from film and comedy to literature and art. Glasgow

  58. WilliamSEO /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Many families in Singapore choose to hire confinement nannies to ease the transition into parenthood and ensure that both mother and baby receive the best possible care during this critical time. Confinement nannies play a vital role in supporting new mothers and helping them adjust to their new roles while promoting the health and well-being of both mother and baby. Singapore confinement nanny

  59. run 3 /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Your blog gave us good knowledge run 3 to work with. Every tip in your post is excellent. Thank you very much for sharing.

  60. WilliamSEO /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    It is ideal time to make a few arrangements for the future and the time has come to be upbeat. I’ve perused this post and on the off chance that I would I be able to want to recommend you few fascinating things or tips. Maybe you could compose next articles alluding to this article. I need to peruse more things about it! 정보이용료현금화

  61. WilliamSEO /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Excellent .. Amazing .. I’ll bookmark your blog and take the feeds also…I’m happy to find so many useful info here in the post. we need work out more techniques in this regard. thanks for sharing. 밤알바

  62. WilliamSEO /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Hello there to everyone, here everybody is sharing such learning, so it’s critical to see this website, and I used to visit this blog day by day 토토사이트

  63. jsimitseo /
    Usando Google Chrome Google Chrome 123.0.0.0 en Windows Windows NT

    Recorded here you’ll learn it is imperative, them offers the connection in an accommodating page: bhutan miracle babies

  64. WilliamSEO /
    Usando Google Chrome Google Chrome 123.0.0.0 en Windows Windows NT

    SIM Card: The SIM card is a small, removable smart card that is inserted into mobile devices such as smartphones, feature phones, and tablets. It stores essential information about the subscriber, including their phone number, network authentication key, and other subscriber-specific data. Embedded SIM

  65. WilliamSEO /
    Usando Google Chrome Google Chrome 123.0.0.0 en Windows Windows NT

    Whether you’re preparing for a special occasion or simply treating yourself to some pampering, our salon is the perfect destination for all your hair care needs. Come visit us today and experience the difference our passion for hair can make! Hair Salon Myrtle Beach SC

  66. Bespoke Strategies singapore /
    Usando Google Chrome Google Chrome 122.0.0.0 en Windows Windows NT

    Love and support from my team thanks Bespoke Strategies singapore

  67. WilliamSEO /
    Usando Google Chrome Google Chrome 123.0.0.0 en Windows Windows NT

    Nice to be visiting your blog again, it has been months for me. Well this article that i’ve been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share. lingerie for bachelorette party

  68. WilliamSEO /
    Usando Google Chrome Google Chrome 123.0.0.0 en Windows Windows NT

    Some Singaporean magicians have gained international recognition, showcasing their talents on stages around the world and contributing to the global magic community. Magic show singapore

  69. WilliamSEO /
    Usando Google Chrome Google Chrome 123.0.0.0 en Windows Windows NT

    Mr Mushies Gummies is likely the name of a brand or product, possibly referring to gummy candies or supplements infused with mushroom extracts. Without more context, it’s difficult to provide further information. If you have specific questions or if there’s something you’d like to know about Mr. Mushies Gummies, feel free to ask!

Leave a Reply to Ordercustomessay Cancle Reply