Skip to content

Instantly share code, notes, and snippets.

@txtyash
Created July 20, 2022 10:16
Show Gist options
  • Save txtyash/57214b94904f89458afae71b90c9d6a2 to your computer and use it in GitHub Desktop.
Save txtyash/57214b94904f89458afae71b90c9d6a2 to your computer and use it in GitHub Desktop.
Scrot commands to take screenshot of active window, selective and fullscreen
#!/bin/bash
# active
scrot -u 'screenshot_%Y%m%d_%H%M%S.png' -e 'mkdir -p ~/screenshots && mv $f ~/screenshots && xclip -selection clipboard -t image/png -i ~/screenshots/`ls -1 -t ~/screenshots | head -1`'
#!/bin/bash
# full
scrot 'screenshot_%Y%m%d_%H%M%S.png' -e 'mkdir -p ~/screenshots && mv $f ~/screenshots && xclip -selection clipboard -t image/png -i ~/screenshots/`ls -1 -t ~/screenshots | head -1`'
#!/bin/bash
# selection
scrot -s 'screenshot_%Y%m%d_%H%M%S.png' -e 'mkdir -p ~/screenshots && mv $f ~/screenshots && xclip -selection clipboard -t image/png -i ~/screenshots/`ls -1 -t ~/screenshots | head -1`'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment