diff options
Diffstat (limited to '')
| -rwxr-xr-x | dmenu-screenshot | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/dmenu-screenshot b/dmenu-screenshot index 1aab461..fb918fd 100755 --- a/dmenu-screenshot +++ b/dmenu-screenshot | |||
| @@ -1,17 +1,26 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | # Screenshot utility | 3 | # Screenshot utility |
| 4 | # Usage: dmenu-screenshot [-m menu] | ||
| 4 | # Requires: dmenu (or similar), imagemagick | 5 | # Requires: dmenu (or similar), imagemagick |
| 5 | 6 | ||
| 6 | menu=${MENU:-dmenu} | 7 | menu="dmenu -i" |
| 7 | menuopts="-i -p" | 8 | prompt="Select type of screenshot:" |
| 8 | menuprompt="Select type of screenshot:" | 9 | |
| 10 | while getopts "m:" opt; do | ||
| 11 | case "$opt" in | ||
| 12 | m) | ||
| 13 | menu="$OPTARG" | ||
| 14 | ;; | ||
| 15 | esac | ||
| 16 | done | ||
| 17 | shift `expr $OPTIND - 1` | ||
| 9 | 18 | ||
| 10 | folder="$HOME/Pictures/screenshots" | 19 | folder="$HOME/Pictures/screenshots" |
| 11 | filename="screenshot_$(date +%Y-%m-%d-%H%M%S).png" | 20 | filename="screenshot_$(date +%Y-%m-%d-%H%M%S).png" |
| 12 | filepath="${folder}/${filename}" | 21 | filepath="${folder}/${filename}" |
| 13 | 22 | ||
| 14 | t=$(echo "Full\nSelection" | $menu $menuopts "$menuprompt") | 23 | t=$(echo "Full\nSelection" | $menu -p "$prompt") |
| 15 | #op="" TODO: remove if not needed | 24 | #op="" TODO: remove if not needed |
| 16 | if [ "$t" = "Full" ]; then | 25 | if [ "$t" = "Full" ]; then |
| 17 | op="-window root" | 26 | op="-window root" |
