Skip to content

Instantly share code, notes, and snippets.

@Dechrissen
Last active June 10, 2025 14:17
Show Gist options
  • Save Dechrissen/db67f2a79a4cdd00909d679adefe41d0 to your computer and use it in GitHub Desktop.
Save Dechrissen/db67f2a79a4cdd00909d679adefe41d0 to your computer and use it in GitHub Desktop.
i3wm keybind for taking a screenshot and saving it to the clipboard as well as a directory
# ----------------------------------------------------------------------------------------------------------------
# Add this to your i3 config to take a screenshot (selection) and save it to the clipboard just by pressing PrtSc!
# The resulting file will have this format: screenshot_02-Dec-2021_13-24-21.png
#
# NOTE: This assumes you have a directory ~/screenshots and you have installed:
# - maim
# - xclip
# ----------------------------------------------------------------------------------------------------------------
# screenshot (saves to clipboard and a file in ~/screenshots)
# key: PrtSc
bindsym Print exec NOW=$(date +%d-%b-%Y_%H-%M-%S) && maim --format png --select > ~/screenshots/screenshot_$NOW.png && xclip -selection clip -t image/png ~/screenshots/screenshot_$NOW.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment