Procházet zdrojové kódy

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

More realistic examples that actually exit when slop is cancelled.
Dalton Nell před 6 roky
rodič
revize
38d2339da9
No account linked to committer's email
1 změnil soubory, kde provedl 4 přidání a 2 odebrání
  1. 4
    2
      README.md

+ 4
- 2
README.md Zobrazit soubor

@@ -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.