aboutsummaryrefslogtreecommitdiff
path: root/misc/bin/screengrab-window.sh
diff options
context:
space:
mode:
Diffstat (limited to 'misc/bin/screengrab-window.sh')
-rwxr-xr-xmisc/bin/screengrab-window.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/misc/bin/screengrab-window.sh b/misc/bin/screengrab-window.sh
new file mode 100755
index 0000000..bfbf73e
--- /dev/null
+++ b/misc/bin/screengrab-window.sh
@@ -0,0 +1,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}"