Print Screen key in i3

Everything inside i3 needs to be bound and just a minimal set of keys is added/generated inside the default config. Some keys that are not letters can be represented with its keycodes or keysyms. More about this subject here:

  • i3 User’s Guide - 4.3. Keyboard bindings

Printscreen is the Print keysym.

I personally use gnome-screenshot to that task, since it can crop images, making life easier. Add the following lines to your .config/i3/config or any config file you are using as the i3wm main config file.

#interactive screenshot by pressing printscreen
bindsym Print exec gnome-screenshot -i 
#crop-area screenshot by pressing Mod + printscreen
bindsym $mod+Print exec gnome-screenshot -a

Some people like to use scrot. That is up to you to decide :) . Example:

bindsym Print exec scrot $HOME/Images/`date +%Y-%m-%d_%H:%M:%S`.png

To expand on @user34720's answer, if bindsym $mod+Print exec gnome-screenshot -a doesn't work, pass the --release parameter to bindsym

bindsym --release Print exec gnome-screenshot -i
bindsym --release $mod+Print exec gnome-screenshot -a

Tags:

I3