getwinbg
Retrieve the current Windows desktop background from Python or the command line.
getwinbg is a lightweight, typed Windows utility that returns the path to
the current desktop background and can optionally reveal or open it, or copy
its path to the clipboard.
Read the full documentation. See the project changelog for release history.
Features
- Retrieve the current Windows desktop background path
- Reveal the background in File Explorer
- Open the background with its default application
- Copy the background path to the Windows clipboard
- Print only the background path for use in scripts
- Python API and command-line interface
- Fully typed package (
py.typed)
Requirements
- Windows
- Python 3.13 or newer
Installation
Install the latest release from PyPI:
pip install getwinbg
To install the current source checkout:
git clone https://github.com/ViratiAkiraNandhanReddy/getwinbg.git
cd getwinbg
pip install .
Usage
CLI
Display the current desktop background:
getwinbg background
Reveal the background file in File Explorer:
getwinbg background --reveal
Open the file with its default image application:
getwinbg background --open
Copy the path as text to the Windows clipboard:
getwinbg background --copy
Print only the path, without the banner or formatted panel:
getwinbg background --path-only
Use -r, -o, and -c as short forms for --reveal, --open, and
--copy. These action options can be combined; they run in reveal, open, and
copy order after the path is displayed. Copying places the path as text on the
clipboard; it does not copy the image file. --path-only is intended for
capturing or piping the path and takes precedence over the action options.
Use getwinbg --version to print the installed package version and
getwinbg --help or getwinbg background --help to inspect command help.
Example output from getwinbg background:
$$\ $$\ $$\
$$ | \__| $$ |
$$$$$$\ $$$$$$\ $$$$$$\ $$\ $$\ $$\ $$\ $$$$$$$\ $$$$$$$\ $$$$$$\
$$ __$$\ $$ __$$\\_$$ _| $$ | $$ | $$ |$$ |$$ __$$\ $$ __$$\ $$ __$$\
$$ / $$ |$$$$$$$$ | $$ | $$ | $$ | $$ |$$ |$$ | $$ |$$ | $$ |$$ / $$ |
$$ | $$ |$$ ____| $$ |$$\ $$ | $$ | $$ |$$ |$$ | $$ |$$ | $$ |$$ | $$ |
\$$$$$$$ |\$$$$$$$\ \$$$$ |\$$$$$\$$$$ |$$ |$$ | $$ |$$$$$$$ |\$$$$$$$ |
\____$$ | \_______| \____/ \_____\____/ \__|\__| \__|\_______/ \____$$ |
$$\ $$ | $$\ $$ |
\$$$$$$ | \$$$$$$ |
\______/ \______/
Retrieve Windows background image paths • vX.X.X
╭───────────────────────────────── getwinbg ─────────────────────────────────╮
│ Current desktop background │
│ │
│ C:\Users\User\Pictures\wallpaper.jpg │
╰────────────────────────────────────────────────────────────────────────────╯
Python API
The recommended API is the Background class:
from getwinbg import Background
background = Background()
print(background.path)
background.reveal()
background.open()
background.copy()
Example output:
C:\Users\User\Pictures\wallpaper.jpg
get_background() remains available for compatibility but is deprecated and
will be removed in version 0.2.0. Use Background().path instead:
from getwinbg import get_background
path = get_background()
Development
Install the development dependencies and run the checks:
pip install -e ".[dev]"
ruff check .
ruff format --check .
ty check
Build the documentation locally:
pip install -r docs/requirements.txt
python -m sphinx -W --keep-going docs docs/_build/html
License
getwinbg is released under the MIT License.
Metadata
Release files for getwinbg 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| getwinbg-0.1.5.tar.gz | 17.4 kB | With provenance | Details for getwinbg-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| getwinbg-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for getwinbg-0.1.5-py3-none-any.whl |
Total release size: 26.3 kB
Release files / getwinbg-0.1.5.tar.gz
| Download URL | getwinbg-0.1.5.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8975e540a2924fd89070557cbe9170b8f4ed66e02432ad3902a6f7971bd21972
|
|
BLAKE2b-256 checksum How to use checksums |
595ccafe0157f25818a36f865e575e7d7b2f28e5c42e0f07f992a9ef518fbf06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logRelease files / getwinbg-0.1.5-py3-none-any.whl
| Download URL | getwinbg-0.1.5-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6824f94df92088eab811af03acbec477134d68bf743f217b535401add737f954
|
|
BLAKE2b-256 checksum How to use checksums |
42e4aba1f54d7612f42f62d6585f80bd4711231558bb498bc09e9108ba9d5e31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logSecurity for getwinbg 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for getwinbg-0.1.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.