Skip to content

Instantly share code, notes, and snippets.

@FranchuFranchu
Created March 24, 2021 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FranchuFranchu/6498f0d8e5d312d65d46182586204985 to your computer and use it in GitHub Desktop.
Save FranchuFranchu/6498f0d8e5d312d65d46182586204985 to your computer and use it in GitHub Desktop.
Screenshot hotkeys with scrot in openbox

This allows you to use the "print screen" key to take screenshots with scrot. The snippet above is to be placed in your openbox configuration file, inside the openbox_config and keyboard tags (with the rest of the keybinds). Since I use lxde, my openbox config file is in ~/.config/openbox/lxde-rc.xml.

You can use shift to copy your screenshots to your clipboard (requires xclip).

You can use ctrl to be able to select a rectangle or a window for the screenshot.

Scrot beeps when taking a screenshot. You can prevent this by adding -z in the scrot commands.

<keybind key='Print'>
<action name='Execute'>
<command>scrot -e &apos;mv $f ~/Screenshots/&apos;</command>
</action>
</keybind>
<keybind key='S-Print'>
<action name='Execute'>
<command>scrot -e &apos;xclip -selection clipboard -t $(file -b --mime-type $f) -i $f; mv $f /dev/null &apos;</command>
</action>
</keybind>
<keybind key='C-Print'>
<action name='Execute'>
<command>scrot -s -e &apos;mv $f ~/Screenshots/&apos;</command>
</action>
</keybind>
<keybind key='C-S-Print'>
<action name='Execute'>
<command>scrot -s -e &apos;xclip -selection clipboard -t $(file -b --mime-type $f) -i $f; mv $f /dev/null &apos;</command>
</action>
</keybind>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment