Posts

Showing posts with the label xwindows

one-button screenshots attempt with scrot and fvwm

 In Gnome desktop, a full-screen screenshot is printscreen, and to snap the current window, it's alt-printscreen.  Gnome desktop has many annoyances, so I tend to use to use fvwm. So far, I've managed to get screenshots working under fvwm using a program called scrot(1) , a shell script wrapping it, and a little fvwm config. scrot is packaged by debian, so installing it is no problem. The invocation to capture the currently focussed window with window manager decorations (borders) is, for example: scrot -u $HOME/scr/%Y-%m-%d.%H.%M.%S.png -b but the directory must already exist, so I wrap it in a shell script I put in ~/bin/screenshot with contents: #!/bin/sh set -e   DIR=$HOME/scr   if ! [ -d "$DIR" ] ; then     mkdir $DIR fi   exec scrot -u $HOME/scr/%Y-%m-%d.%H.%M.%S.png -b      To bind this to alt-printscreen in fvwm, I have this config in .fvwm/config : Key Print A M Exec exec screenshot   The Print means the printsc...