Copy Windows screenshots into WSL for easy reuse.
Project description
Windows Screenshot for Linux
wslshot is a CLI tool designed to fetch the latest screenshot(s) from a directory shared with a Windows host, copy them to a designated directory in a Linux VM, and output their new paths in a configurable style (Markdown, HTML, or text).
Take a screenshot using the Windows Snipping tool (win + shift + S), then run wslshot in your terminal to transfer the image.
Table of Contents
- Features
- AI Agent Snippet
- Installation
- Quick Start
- Windows Configuration
- Shared Directory Configuration
- Configuration
- Fetching Screenshots
- Using a Specific Image Path
- Vim Integration
Features
- Set a default source directory for screenshots.
- Designate a custom source or destination directory per operation, or let wslshot detect typical image directories automatically.
- Fetch the most recent screenshot or specify a number of recent screenshots to fetch.
- Print source paths without copying files using
--no-transfer. - Control automatic staging of screenshots when copied to a git repository.
- Convert screenshots to
png,jpg/jpeg,webp, orgifduring copy (flag or default). - Optimize copied screenshots in place without changing filenames or extensions.
- Set a default output style (Markdown, HTML, text) and specify a custom style per operation.
- Migrate legacy config values with
migrate-config --dry-run.
AI Agent Snippet
Nice thing to have in your AGENTS.md:
## Screenshots ("use/look at a screenshot")
* Run `wslshot -n <number> --no-transfer` to pick n screenshots.
* Run `wslshot --optimize` to copy the latest screenshot and optimize it when preparing docs/images.
Example
Look at my last screenshot.
The agent will run wslshot -n 1 --no-transfer and inspect it.
Installation
Ensure you have Python 3.10 or later installed on your system.
Install with pip
python3 -m pip install wslshot
Install with uv
uv tool install wslshot
Quick Start
This assumes your Windows screenshots are already saved in a directory your Linux environment can access.
wslshot configure --source /path --destination /path
wslshot
Windows Configuration
Before using wslshot, you need to ensure that your screenshots are automatically saved to a directory accessible by your Linux environment.
For Windows 11 Users
The Windows Snipping Tool in Windows 11 supports automatic saving of screenshots (it should be enabled by default):
- Open the Snipping Tool.
- Click on "Settings...".
- Toggle the box that says "Automatically save screenshots".
For Windows 10 Users
The Snipping Tool in Windows 10 doesn't support automatic saving. However, you can use the following methods to automatically save screenshots:
- Use
Win + PrtScn: It captures the entire screen and saves toC:\Users\[Your Username]\Pictures\Screenshots. - Use
Win + Alt + PrtScn: It captures the active window and saves toC:\Users\[Your Username]\Videos\Captures.- To unify the save directory, right-click on the
Capturesdirectory, select Properties, and set your desired directory in the Location tab.
- To unify the save directory, right-click on the
- Use a third-party tool.
You can still use the Snipping Tool, but you'll need to manually save each screenshot after capturing it.
Shared Directory Configuration
For wslshot to fetch screenshots from your Windows host, you need to set up a shared directory between your Windows host and your Linux VM.
For WSL Users
If you are using the Windows Subsystem for Linux (WSL), you can directly access your Windows file system from your WSL distro. The Windows C: drive, for example, can be found at /mnt/c/ within your WSL environment. Therefore, you can directly use a directory on your Windows file system as the source directory for wslshot.
For Virtual Machine Users
If you are using a traditional virtual machine managed by a hypervisor (e.g., VirtualBox, VMware, Hyper-V), you'll need to set up a shared directory with your Windows host and the Linux VM. The process varies depending on your hypervisor, but here are general steps:
- Choose a directory on your Windows host to use as your screenshot directory. This should be the same directory where you configured your Snipping Tool to automatically save screenshots.
- Go into your VM settings and locate the shared directories option. Add the chosen screenshot directory as a shared directory.
- Depending on your VM settings, this directory will now be available at a certain path in your Linux environment. Use this path as your source directory for
wslshot.
Remember to consult the documentation of your hypervisor for specific instructions on how to set up shared directories.
Configuration
Configure wslshot to suit your needs using the configure command:
wslshot configure [--source /path] [--destination /path] [--auto-stage-enabled True] [--output-style HTML] [--convert-to png]
This command allows you to set various options:
-
--sourceor-s: This option lets you specify the default source directory wherewslshotwill look for screenshots. -
--destinationor-d: This option lets you specify the default destination directory wherewslshotwill copy screenshots. When running inside a git repository, this default is ignored unless you pass--destinationon that command; otherwise,wslshotuses repository image directories (/img/,/images/,/assets/img/,/assets/images/) in that order. -
--auto-stage-enabled: This option lets you control whether screenshots are automatically staged when copied to a git repository. By default, this option is set toFalse. If this option is set toTrue, any screenshot copied to a git repository will automatically be staged for commit. -
--output-style: This option lets you set the default output style for the links to the screenshots thatwslshotcreates. The available styles are Markdown, HTML, and text. If you do not set this option,wslshotwill output links in Markdown format by default. -
--convert-toor-c: Set the default image conversion format. Supported formats: png, jpg, jpeg, webp, gif. Conversion runs after copying; the converted file replaces the copied original.jpegis treated asjpg. A CLI--convert-toflag overrides this default.
These are default settings. Override them on a per-operation basis by providing the corresponding options when running the wslshot command.
Migrate older configuration keys to the current names with migrate-config:
wslshot migrate-config --dry-run
wslshot migrate-config
Use --dry-run to preview changes without writing the config file.
Fetching Screenshots
Fetch screenshots with the wslshot command:
wslshot
This fetches the most recent screenshot from the source directory. If run inside a git repository, wslshot looks for an existing image directory (checked in priority order) and copies the screenshot there. If none exists, it creates /assets/images/.
Directories checked in priority order:
/img//images//assets/img//assets/images/
You can also choose a specific number of screenshots:
wslshot -n 3
This fetches the three most recent screenshots.
Print source paths without copying files:
wslshot --no-transfer
This prints the source paths for the selected screenshots without copying files or interacting with git. Output defaults to text; override with --output-style.
This mode rejects flags that require transfer (--destination, --convert-to, --optimize).
Convert screenshots to a different format:
wslshot --convert-to png
This converts the screenshot(s) to the specified format. Supported formats: png, jpg, jpeg, webp, gif. If a default conversion is set in configuration, it runs when no flag is provided. Conversion happens after copying, and the converted file replaces the copied original. If auto-staging is enabled in a git repository, only the converted file is staged. Conversion is skipped only when the copied file already has the target extension; .jpeg files are rewritten to .jpg. Conversion applies both to the latest-screenshot workflow and when you pass a specific image path.
Optimize copied screenshots in place:
wslshot --optimize
This optimizes copied screenshots after transfer and rewrites destination files in place. Source files are never modified. Optimization preserves each copied file's extension. If a default conversion format is configured, --optimize takes precedence for that run and skips conversion.
--optimize conflicts with --no-transfer and --convert-to.
Allow symlinks (security risk):
wslshot --allow-symlinks
WARNING: Only use with trusted paths. By default, wslshot rejects symlinks for security.
These are all the possible options:
wslshot [--source /custom/source] [--destination /custom/destination] [--count 3] [--output-style HTML] [--no-transfer] [--convert-to png] [--optimize] [--allow-symlinks]
Notes:
--no-transfercannot be combined with--destination,--convert-to, or--optimize.--optimizecannot be combined with--convert-to.
Using a Specific Image Path
Provide the path to a specific image as an argument:
wslshot /mnt/c/user/my_name/Images/magic.gif
Note that you can drag and drop a file into the Windows Terminal to automatically populate its path.
Output
Upon success, the command outputs the new path in your configured output style (Markdown by default). Override per run with --output-style:

File Copy Behavior
The specified image is copied to your designated directory on the Linux VM.
Supported source image formats are PNG, JPEG/JPG, and GIF.
Vim Integration
If wslshot is in your PATH, call it with a filter command:
:.!wslshot
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wslshot-0.1.1.tar.gz.
File metadata
- Download URL: wslshot-0.1.1.tar.gz
- Upload date:
- Size: 25.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c55acfcbebe8f0babaf5ce5fb2df0c2f45a2298303829a2e51d3bc9fa32c402
|
|
| MD5 |
d4d2f1e25ce4b5105bc17ace43ba2960
|
|
| BLAKE2b-256 |
bbe82a02076ab938a9990cd5ffbfd79550944fc412e5ad310e49155d93efe415
|
File details
Details for the file wslshot-0.1.1-py3-none-any.whl.
File metadata
- Download URL: wslshot-0.1.1-py3-none-any.whl
- Upload date:
- Size: 26.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec6c3f32f21d43af1db16bb68b26d9f8f9f28ed3fe712955a17211eeff6ba90b
|
|
| MD5 |
b8fda5ea7551b2ee1d6c3efa40a28125
|
|
| BLAKE2b-256 |
58880d7fa1a080cc3b0d38096453ac81f696162bfdc04ea5f3db38964d90233e
|