Explorar el Código

Merge pull request #90 from jfly/exit-on-slop-cancel

More realistic examples that actually exit when slop is cancelled.
Dalton Nell hace 6 años
padre
commit
38d2339da9
Ninguna cuenta está vinculada al correo electrónico del colaborador
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4
    2
      README.md

+ 4
- 2
README.md Ver fichero

@@ -18,14 +18,16 @@ slop (Select Operation) is an application that queries for a selection from the
18 18
 slop can be used to create a video recording script in only two lines of code.
19 19
 ```bash
20 20
 #!/bin/bash
21
-read -r X Y W H G ID < <(slop -f "%x %y %w %h %g %i")
21
+slop=$(slop -f "%x %y %w %h %g %i") || exit 1
22
+read -r X Y W H G ID < <(echo $slop)
22 23
 ffmpeg -f x11grab -s "$W"x"$H" -i :0.0+$X,$Y -f alsa -i pulse ~/myfile.webm
23 24
 ```
24 25
 
25 26
 You can also take images using imagemagick like so:
26 27
 ```bash
27 28
 #!/bin/bash
28
-read -r G < <(slop -f "%g")
29
+slop=$(slop -f "%g") || exit 1
30
+read -r G < <(echo $slop)
29 31
 import -window root -crop $G ~/myimage.png
30 32
 ```
31 33
 If you don't like ImageMagick's import: Check out [maim](https://github.com/naelstrof/maim) for a better screenshot utility.