A confirmation dialog for URxvt’s Print Screen key

I use urxvt’s kuake plugin as a lighter replacement for Yakuake and, as a result, I’m using it with F12 as my “toggle terminal” keybind.

…unfortunately, that means that, every time my finger slips, I hit Print Screen.

As such, I wrote this little script you can use to Print Screen to file, with a confirmation dialog to avoid the need to keep deleting unwanted printouts.

confirm_print.sh (fixed commit ID)

To use it:

  1. Copy it to somewhere like ~/bin/confirm_print.sh
  2. Make sure zenity is installed
  3. Add these lines to your ~/.Xresources
    Rxvt.print-pipe: ~/bin/confirm_print.sh
    URxvt.print-pipe: ~/bin/confirm_print.sh
    
  4. Run xrdb -merge ~/.Xresources
  5. Restart any terminals you may have. (You are using screen or tmux, right?)

CC BY-SA 4.0 A confirmation dialog for URxvt’s Print Screen key by Stephan Sokolow is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

This entry was posted in Geek Stuff. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution under the same terms as the associated post.       Also, please be aware that non-constructive comments will have their URL field erased before being approved in order to combat SEO spam.