Skip to content

Watches clipboard and automatically saves any new images, text, and files.

License

Notifications You must be signed in to change notification settings

caglartoklu/shotlast

Repository files navigation

shotlast

Watches clipboard and automatically saves any new images, text and files.

After run, this program will watch the clipboard.

When a new image/text/file is detected, it saves the contents of clipboard with date and time (year to second) information, such as: clip_20201203_101701.png

  • It never deletes a previous image/text/file.
  • It is fully automatic, you simply fill the clipboard from any source. shotlast does the rest.
  • It is useful to save repetitive screenshots from Youtube, Udemy, online meetings, books etc.

In a session, your set of files will look like this:

https://user-images.githubusercontent.com/2071639/101167570-2409c800-364b-11eb-9393-7dd7daff8cd9.png

https://user-images.githubusercontent.com/2071639/101167591-2ff58a00-364b-11eb-9f6e-f1b9077468a6.png

Installation

pip install git+https://github.com/caglartoklu/shotlast

After installation, pip will create an executable (shotlast) for shotlast.

shotlast then can be used from command line as follows:

shotlast
shotlast C:\Downloads\Pictures

Installation Notes for Windows

1 PATH variables

Note that, on Windows, C:\Python3x\Scripts directory is NOT automatically added to PATH variables. It is advised to add this directory to PATH variables.

or, launch it with a command like this:

C:\Python37\Scripts\shotlast.exe

Installation Notes for Linux

Currently, Linux is not supported, working on it. See Issue 3 "Linux Feedback"

1 Tkinter

Tkinter is not installed on some Linux derivatives by default. For Debian Linux derivatives, it is installed by:

sudo apt-get install python3-tk

2 copy/paste mechanism

shotlast uses xclip to save images from clipboard on Linux. On Debian derivatives, xclip can be installed as follows:

sudo apt-get install xclip

Command Line Options

C:\projects> shotlast --help
usage: shotlast [-h] [--period [PERIOD]] [target_dir]

positional arguments:
  target_dir         Target directory to store the saved clipboard files.

optional arguments:
  -h, --help         show this help message and exit
  --period [PERIOD]  Sleep duration (in seconds) between two clipboard checks.

Examples:

# make the user select the target directory to save clipboard images:
# period will be 2 (the default value)
shotlast

# make the user select the target directory to save clipboard images:
# period will be 3, the provided value.
shotlast --period 3

# use the values as provided:
shotlast --period 3 c:\Pictures\

Compatibility and Requirements

Runtime Requirements

  • Required Python packages are defined in setup.py file.
  • Officially, minimum tested Python version supported is 3.7
  • Untested: should work with Python 3.5 and above, but not lower, since it uses argparse and pathlib.

Windows 10

Tested and developed with Python 3.7.4 on Windows 10.

Linux

Currently, Linux is not supported, working on it. See Issue 3 "Linux Feedback"

macOS

Currently, macOS is not supported, working on it.

Development

makefile: makepile.py

makepile.py is the make file of this project. It has no dependencies and it is written in pure Python.

It provides the following commands that can be run from command line:

python makepile.py

Shows the main menu of makepile.py and possible targets.

python makepile.py
Possible targets:
['clean', 'ctags', 'install', 'linecount', 'pyinstaller', 'readme', 'run', 'uninstall']

Development Environment

shotlast is configured to work with Pipenv. It needs to be installed like this:

pip install --user pipenv
# or
pip install pipenv

Then, after clonning the project, the environment can be created with the following commands:

pipenv shell

# install default packages
pipenv install

# install both default and dev packages
pipenv install --dev

A requirements.txt file is also provided for virtualenvwrapper. It can be regenerated with the following command:

pipenv requirements --dev > requirements.txt

makepile.py can also use the following tools:

  • cloc to count the lines in the project.
  • ctags to generate tags.

Licence

MIT Licensed. See the LICENSE.txt file.

About

Watches clipboard and automatically saves any new images, text, and files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages