Created
February 4, 2018 01:42
-
-
Save Dobbie03/e1b54d2e6815c39be0fbae6494a441bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # Take a screenshot and display a notification. | |
| # | |
| # Created by Dylan Araps. | |
| # | |
| # Depends on: imagemagick, libnotify (patched with id support) | |
| # Screenshot directory | |
| scr_dir="${HOME}/Screenshots/ArchLabs" | |
| mkdir -p "$scr_dir" || { printf "%s\n" "Error: Couldn't create screenshot directory"; exit; } | |
| # Use printf to store the current date/time as variables. | |
| printf -v date "%(%F)T" | |
| printf -v time "%(%I-%M-%S)T" | |
| # Create current date format. | |
| mkdir -p "${scr_dir}/${date}" | |
| # Name the screenshot | |
| scr="${scr_dir}/${date}/${date}-${time}.png" | |
| notify-send " Saved screenshot as ${scr/*\/}" | |
| scrot "$scr" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment