Skip to content

Instantly share code, notes, and snippets.

@chespinoza
Forked from dianjuar/i3-shortcuts-screenshot.md
Created November 10, 2021 18:14
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 chespinoza/7888944934815a3c550cfe6427cdcd90 to your computer and use it in GitHub Desktop.
Save chespinoza/7888944934815a3c550cfe6427cdcd90 to your computer and use it in GitHub Desktop.
My i3 shortcuts to take screenshots

Requirements

  • maim
  • xclip

Set-up

Set this on your i3 config file ~/.i3/config

# Screenshots
bindsym Print exec --no-startup-id maim "/home/$USER/Pictures/$(date)"
bindsym $mod+Print exec --no-startup-id maim --window $(xdotool getactivewindow) "/home/$USER/Pictures/$(date)"
bindsym Shift+Print exec --no-startup-id maim --select "/home/$USER/Pictures/$(date)"

## Clipboard Screenshots
bindsym Ctrl+Print exec --no-startup-id maim | xclip -selection clipboard -t image/png
bindsym Ctrl+$mod+Print exec --no-startup-id maim --window $(xdotool getactivewindow) | xclip -selection clipboard -t image/png
bindsym Ctrl+Shift+Print exec --no-startup-id maim --select | xclip -selection clipboard -t image/png

You may remove the default screenshot shortcuts to prevent error

What it do

Feature Shortcut
Full Screen PrtScrn
Selection Shift + PrtScrn
Active Window Super + PrtScrn
Clipboard Full Screen Ctrl + PrtScrn
Clipboard Selection Ctrl + Shift + PrtScrn
Clipboard Active Window Ctrl + Super + PrtScrn

All the screen shots are saved on ~/Pictures/CURRENT_DATE

super key is the windows key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment