diff options
Diffstat (limited to '')
| -rwxr-xr-x | dmenu-screenshot | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/dmenu-screenshot b/dmenu-screenshot new file mode 100755 index 0000000..1aab461 --- /dev/null +++ b/dmenu-screenshot | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # Screenshot utility | ||
| 4 | # Requires: dmenu (or similar), imagemagick | ||
| 5 | |||
| 6 | menu=${MENU:-dmenu} | ||
| 7 | menuopts="-i -p" | ||
| 8 | menuprompt="Select type of screenshot:" | ||
| 9 | |||
| 10 | folder="$HOME/Pictures/screenshots" | ||
| 11 | filename="screenshot_$(date +%Y-%m-%d-%H%M%S).png" | ||
| 12 | filepath="${folder}/${filename}" | ||
| 13 | |||
| 14 | t=$(echo "Full\nSelection" | $menu $menuopts "$menuprompt") | ||
| 15 | #op="" TODO: remove if not needed | ||
| 16 | if [ "$t" = "Full" ]; then | ||
| 17 | op="-window root" | ||
| 18 | else | ||
| 19 | pkill xbanish # otherwise I can't use mouse to select area | ||
| 20 | fi | ||
| 21 | |||
| 22 | [ -n "$t" ] && sleep 0.1 && import $op $filepath | ||
| 23 | spawn xbanish # This can be removed if you don't use xbanish | ||
