This script combines together many programs in order to provide convenient and fast way to take and publish screenshots.
- Interactively configurable
- Configuration is cached between different runs
- Automated image pasting
- Visual notifications
- Clipboard management
No building required as the script is written in bash. However, a few dependencies are required to run the script (some of them might require building):
- dmenu (menu)
- scrot (screenshot program)
- zenity (user interaction)
- xclip (clipboard management)
- libnotify (send visual notifications using notify-send)
- notify-osd (or notification-daemon, or any other alternative)
- imagepaste (a program to publish images on image hosting sites)
- terminus-font (font in dmenu, optional)
In order to take a screenshot and interactively configure its options, run without arguments:
To load options cached from previous run, add "cached" argument:
$ screenshot.sh cached
It's convenient to configure hot keys to run the script. Exact configuration
highly depends on your environment. In openbox you can use obkey configuration
tool or add the following to
<keybind key="Print"> <action name="Execute"> <command>screenshot.sh cached</command> </action> </keybind> <keybind key="W-Print"> <action name="Execute"> <command>screenshot.sh</command> </action> </keybind>
The only way to configure the script at the moment is to modify internal
variables which are located in
init() function. They include:
LOG- path to log file. Make sure the file exists and you have write access to it.
FONT- font name used in dmenu.
DMENU- dmenu command.
IMAGEPASTE_CMD- program to paste images to web.
SCREENSHOT_CMD- program to take screenshots.
SCREENSHOT_OPTIONS- additional options to the screenshot command.
BASEDIR- base dir for your screenshots. Prompts for file name will contain this path by default.
CACHE- path to the file where to save cached options.
PATTERN_INDEX- start index for patterned file names.
NOTIFICATION_TIMEOUT- timeout for notification baloon.
(c) 2011, 2012 Yuri Bochkarev