Skip to content

Commit

Permalink
update shebang (fixes issue #7), small updates to make shellcheck happy
Browse files Browse the repository at this point in the history
  • Loading branch information
phisch committed Aug 24, 2020
1 parent a6f34d9 commit e3673b1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/giph
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

stty -echoctl # don't print ^C when pressing ctrl+c

Expand Down Expand Up @@ -238,6 +238,9 @@ function get_geometry_from_window_id() {
xdotool_output=$(xdotool getwindowgeometry --shell "$1" 2> /dev/null)
[ $? = 1 ] && log_error "window with id $1 does not exist"

WIDTH=0
HEIGHT=0

eval "$xdotool_output"

[[ $X != "-"* ]] && X="+$X"
Expand Down Expand Up @@ -280,11 +283,11 @@ function parse_geometry_string() {
}

[ $((x+width)) -gt "$WIDTH" ] && {
let width-=$((x + width - WIDTH))
width-=$((x + width - WIDTH))
}

[ $((y+height)) -gt "$HEIGHT" ] && {
let height-=$((y + height - HEIGHT))
height-=$((y + height - HEIGHT))
}

log "parsed geometry: width=$width, height=$height, x=$x, y=$y" 2 true
Expand All @@ -301,7 +304,7 @@ function start_video_recording() {
ffmpeg+=(-f x11grab)
ffmpeg+=(-framerate "$FRAMERATE")
ffmpeg+=(-s "$width"x"$height")
ffmpeg+=(-i :0.0+"$x","$y")
ffmpeg+=(-i ":0.0+$x,$y")
ffmpeg+=(-preset ultrafast)
ffmpeg+=(-crf 0)

Expand Down

0 comments on commit e3673b1

Please sign in to comment.