Browse Source

Simplified manual parsing example.

koalaman 9 years ago
parent
commit
b976f5698a
1 changed files with 3 additions and 9 deletions
  1. 3
    9
      README.md

+ 3
- 9
README.md View File

39
 For those of you who don't want eval to be an integral part of slop (Could be dangerous if I were evil!): You can change the output format and parse it manually like so:
39
 For those of you who don't want eval to be an integral part of slop (Could be dangerous if I were evil!): You can change the output format and parse it manually like so:
40
 ```bash
40
 ```bash
41
 #!/bin/bash
41
 #!/bin/bash
42
-slopoutput=$(slop -f "%x %y %w %h %g $i")
43
-X=$(echo $slopoutput | awk '{print $1}')
44
-Y=$(echo $slopoutput | awk '{print $2}')
45
-W=$(echo $slopoutput | awk '{print $3}')
46
-H=$(echo $slopoutput | awk '{print $4}')
47
-G=$(echo $slopoutput | awk '{print $5}')
48
-ID=$(echo $slopoutput | awk '{print $6}')
49
-maim -g $G -i $ID
50
-ffmpeg -f x11grab -s "$W"x"$H" -i :0.0+$X,$Y -f alsa -i pulse ~/myfile.webm
42
+read -r X Y W H G ID < <(slop -f "%x %y %w %h %g %i")
43
+maim -g "$G" -i "$ID"
44
+ffmpeg -f x11grab -s "$W"x"$H" -i ":0.0+$X,$Y" -f alsa -i pulse ~/myfile.webm
51
 ```
45
 ```
52
 
46
 
53
 ## Lets see some action
47
 ## Lets see some action