3 # am7xxx-play-window - show only a given window with am7xxx-play
 
   5 # Copyright (C) 2013-2014  Antonio Ospite <ao2@ao2.it>
 
   7 # This program is free software. It comes without any warranty, to
 
   8 # the extent permitted by applicable law. You can redistribute it
 
   9 # and/or modify it under the terms of the Do What The Fuck You Want
 
  10 # To Public License, Version 2, as published by Sam Hocevar. See
 
  11 # http://sam.zoy.org/wtfpl/COPYING for more details.
 
  17 WIN_INFO="$(xwininfo)"
 
  19 X=$(echo "$WIN_INFO" | sed -n -e "/^[[:space:]]*Absolute upper-left X:[[:space:]]*/s///p")
 
  20 Y=$(echo "$WIN_INFO" | sed -n -e "/^[[:space:]]*Absolute upper-left Y:[[:space:]]*/s///p")
 
  21 WIDTH=$(echo "$WIN_INFO" | sed -n -e "/^[[:space:]]*Width:[[:space:]]*/s///p")
 
  22 HEIGHT=$(echo "$WIN_INFO" | sed -n -e "/^[[:space:]]*Height:[[:space:]]*/s///p")
 
  25 am7xxx-play -f x11grab -i "${DISPLAY}+${X},${Y}" -o video_size="${WIDTH}x${HEIGHT}"