betlog

screenshot-active.sh

Jul 8th, 2019
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.98 KB | None | 0 0
  1. #!/bin/bash
  2.     output="/home/user/pictures/screenshots/$(date +%Y-%m-%d--%H-%M-%S)_active.png"
  3.     focusWindow=$(xdotool getwindowfocus getwindowfocus)
  4.     import -screen -window ${focusWindow} ${output}
  5.     kdialog --title "ACTIVE WINDOW Screenshot" --passivepopup "${output}" 3
  6.  
  7.  
  8.     echo '#!/bin/bash'> /tmp/screenshotPrior
  9.     echo 'output=/home/user/pictures/screenshots/$(date +%Y-%m-%d--%H-%M-%S)_redo.png'>> /tmp/screenshotPrior
  10.     echo 'import -screen -window '${focusWindow}' ${output}'>> /tmp/screenshotPrior
  11.     echo 'kdialog --title "REDO ACTIVE WINDOW Screenshot" --passivepopup "${output}" 3'>> /tmp/screenshotPrior
  12.     chmod +x /tmp/screenshotPrior
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20. # chmod +x /tmp/screenshotPrior
  21.  
  22.  
  23.  
  24. # import -screen -window $(xdotool getwindowfocus getwindowfocus) ${output}
  25. # xwininfo | grep -i 'window id'
  26. # xprop -id $(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2) WM_CLIENT_LEADER
  27. # export screenshotPrior=import -screen -window $(xdotool getwindowfocus getwindowfocus) ${output}
Advertisement
Add Comment
Please, Sign In to add comment