Skip to main content

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.

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
  • 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

Use -r, -o, and -c as short forms for --reveal, --open, and --copy. These options can be combined. Copying places the path on the clipboard; it does not copy the image file. The global --version option prints the installed package version:

getwinbg --version

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.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for getwinbg 0.1.4
File Size Uploaded Provenance Actions
getwinbg-0.1.4.tar.gz 15.9 kB With provenance Details for getwinbg-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for getwinbg 0.1.4
File Interpreter ABI Platform Actions
getwinbg-0.1.4-py3-none-any.whl Python 3 none any Details for getwinbg-0.1.4-py3-none-any.whl

Total release size: 24.5 kB

Release files / getwinbg-0.1.4.tar.gz

Download URL getwinbg-0.1.4.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a09412dad16182a7e17d960e07b84006a27752745e7f0af25c7a8b2d983ab31b
BLAKE2b-256 checksum
How to use checksums
0cef3068b5da54ca6684fd2dc9f7a6071e8f49beb8a961258cb729b08a2542eb
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 27, 2026.

Transparency log

Release files / getwinbg-0.1.4-py3-none-any.whl

Download URL getwinbg-0.1.4-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
feb41a5916dec80d80ba7a768e3634446a252acf3d7325f8c57eb9c93224db37
BLAKE2b-256 checksum
How to use checksums
221a71a33205fd91fac2d6402794dfec8467630468e6bd51394b332822ca366c
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 27, 2026.

Transparency log

Security for getwinbg 0.1.4

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.

Select from 2 files

Attestation for getwinbg-0.1.4.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 27, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page