Tag Archives: obenbox

Take Screenshots on LXDE

Edit the following in ~/.config/openbox/lxde-rc.xml:

   

<keybind key="Print">
      <action name="Execute">
        <command>screenshot-desktop.sh</command>
      </action>
    </keybind>
    <keybind key="A-Print">
      <action name="Execute">
        <command>screenshot-window.sh</command>
      </action>
    </keybind>

To take a full desktop screenshot:

#!/bin/bash
DATE=`date +%Y-%m-%d\ %H\:%M\:%S`
xwd -root | convert - "$HOME/Desktop/Screenshot-$DATE.png"
notify-send "Desktop screenshot saved!" "A descktop screenshot was saved on your Desktop as:\n Screenshot-$DATE.png" -i /usr/share/icons/Tango/scalable/devices/camera.svg

screenshot-desktop.sh

To take the current window screenshot:

#!/bin/bash
 activeWinLine=$(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)")
 activeWinId="${activeWinLine:40}"
 activeWinTitle=$(xwininfo -id $activeWinId | grep 'Window id:' | cut -d"\"" -f2)


COUNTER=0
FILENAME="$HOME/Desktop/$activeWinTitle-Screenshot.png"

while [ -f "$FILENAME" ]; do
  let COUNTER=COUNTER+1
  FILENAME="$HOME/Desktop/$activeWinTitle-Screenshot-$COUNTER.png"
done


 import -window $activeWinId "$FILENAME"

notify-send "Window screenshot saved!" "Windows screenshot was saved on your Desktop as:\n $FILENAME" -i /usr/share/icons/Tango/scalable/devices/camera.svg

screenshot-window.sh