Bladeren bron

More realistic examples that actually exit when slop is cancelled.

Jeremy Fleischman 7 jaren geleden
bovenliggende
commit
dea8c069c6
1 gewijzigde bestanden met toevoegingen van 4 en 2 verwijderingen
  1. 4
    2
      README.md

+ 4
- 2
README.md Bestand weergeven

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