aboutsummaryrefslogtreecommitdiff
path: root/misc/bin/screengrab-window.sh
blob: bfbf73e7bb41e1b5c3c7d80485f3f82a45a676ad (plain) (blame)
1
2
3
4
5
6
7
#!/bin/bash

filename1="$MY_SCREENSHOTS_DIR/$(date +%Y-%m-%d--%H-%M-%S)_"
filename2="$(xdotool getactivewindow getwindowname | sed -r 's/[^a-zA-Z0-9\-]+/_/g')" #get the title of the window, and replace non alphanumerics with '_'
filename3='.png'
scrot "${filename1}${filename2}${filename3}" -u
xclip -r -selection clipboard <<<"$HOME${filename1}${filename2}${filename3}"