Browse Source

More realistic examples that actually exit when slop is cancelled.

Jeremy Fleischman 6 years ago
parent
commit
dea8c069c6
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      README.md

+ 4
- 2
README.md View File

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