Guest User

Untitled

a guest
Jan 24th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. #
  3. # Take a screenshot and display a notification.
  4. #
  5. # Created by Dylan Araps.
  6. #
  7. # Depends on: imagemagick, libnotify (patched with id support)
  8.  
  9. # Screenshot directory
  10. scr_dir="${HOME}/Screenshots/ArchLabs"
  11. mkdir -p "$scr_dir" || { printf "%s\n" "Error: Couldn't create screenshot directory"; exit; }
  12.  
  13. # Use printf to store the current date/time as variables.
  14. printf -v date "%(%F)T"
  15. printf -v time "%(%I-%M-%S)T"
  16.  
  17. # Create current date format.
  18. mkdir -p "${scr_dir}/${date}"
  19.  
  20. # Name the screenshot
  21. scr="${scr_dir}/${date}/${date}-${time}.png"
  22.  
  23. notify-send " Saved screenshot as ${scr/*\/}"
  24. scrot "$scr"
Add Comment
Please, Sign In to add comment