Skip to content

Screenshot helper for sway: put your screenshots to XDG_PICTURES_DIR folder or send it to https://x0.at. Mirror of https://gitlab.com/radio_rogal/swayshot

License

Notifications You must be signed in to change notification settings

vitalijr2/swayshot

Repository files navigation

swayshot

Screenshot helper for sway.

It adds keyboard shortcuts to take screenshot:

  • Print Scr made screenshot for whole screen
  • Alt + Print Scr made screenshot for a focused window
  • Shift + Print Scr made screenshot for a selected region
  • Super + Print Scr made screenshot for whole screen then upload it to 0x0.st
  • Super + Alt + Print Scr made screenshot for a focused window then upload it to 0x0.st
  • Super + Shift + Print Scr made screenshot for a selected region then upload it to 0x0.st

Screenshot has made by swayshot

Note: since 2.7.0 it uses 0x0.st instead of x0.at.

Customization

It saves screenshots to XDG_PICTURES_DIR (usually $HOME/Pictures), see more details on XDG user directories.

Default template of screenshot filename is screenshot_YYYY-MM-DD_HH24-MI-SS_SSS.png. But you can change path and timestamp format

User variables in ~/.config/swayshot.sh.

  • SWAYSHOT_SCREENSHOTS defines your own screenshot folder;
  • SWAYSHOT_DATEFMT defines timestamp format (see man date), thanks Ranieri Althoff for help.
  • SWAYSHOT_WL_COPY_FILE defines whether the image file itself should be copied to clipboard.

Path to last screenshot

If wl-clipboard (wl-copy), xsel or xclip exist it copies full path to clipboard. Otherwise just prints it to stdout. With wl-clipboard, the SWAYSHOT_WL_COPY_FILE config variable allows you to copy the image file itself.

How do I get set up?

Archlinux

Just install the AUR package swayshot

Other Linux distributions

Requires:

  • grim
  • jq
  • slurp
  • sway (certainly)

Optional dependencies:

  • xsel
  • xclip
  • wl-clipboard

You need to copy files:

  • swayshot.conf copy to /etc/sway/config.d;
  • swayshot.sh copy to /usr/bin as swayshot and make it executable.

Then just reload Sway's configuration file (usually it's $mod + Shift + c).

Contributing

Please read Contributing.

History

See Changelog

License

Copyright 2017,2019,2021 Witalij Berdinskich

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

GNU General Public License, Version 3
License

Acknowledgements

I would like to say thanks to people who point something wrong in my code or propose improvements:

About

Screenshot helper for sway: put your screenshots to XDG_PICTURES_DIR folder or send it to https://x0.at. Mirror of https://gitlab.com/radio_rogal/swayshot

Topics

Resources

License

Stars

Watchers

Forks

Languages