aboutsummaryrefslogtreecommitdiff
path: root/misc/bin/screengrab.sh
blob: f1f870491b13ef908d229abf299e3df7e3eebc06 (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}" -s
xclip -r -selection clipboard <<<"$HOME${filename1}${filename2}${filename3}"