Skip to main content

🖼️ Py Bg Changer

PyPI Python Versions GitHub repo size Tests GitHub License Code Style: Black uv

Simple cross-platform wallpaper changer made with Python. Change your desktop wallpaper from the terminal, Win+R or any launcher. Works on Windows, macOS and Linux, with no dependencies.

The command is py-bg-changer, and pbc is the short alias for it.

📥 Installation

you can install the latest version from PyPI with uv (recommended):

uv tool install py-bg-changer

or try it without installing:

uvx --from py-bg-changer pbc --help

prefer pip? pipx install py-bg-changer or pip install py-bg-changer work too. Needs Python 3.10+.

📖 Usage

pbc add night ~/Pictures/night.jpg   # save an image under a name
pbc add night img.jpg -a n -a dark   # ...and give it extra names (aliases)
pbc add night img.jpg --default      # ...or make it the default right away
pbc alias night moon                 # add more aliases later
pbc rename night midnight            # rename a wallpaper or an alias
pbc night                            # set it by name (or any alias: pbc n)
pbc ~/Pictures/any.png               # or set any image directly
pbc random                           # set a random saved wallpaper
pbc list                             # see what you saved (* marks the default); `pbc ls` works too
pbc default night                    # choose what a plain "pbc" sets
pbc remove night                     # forget a name (or just an alias)
pbc                                  # set the default wallpaper

If a saved name clashes with a command (say, one called list, ls, default or random), use pbc set list.

🛠 Getting Started

follow the instruction to install Py Bg Changer from source (to try the latest code or to work on it):

  1. Clone Code

    use Git on your system

    git clone https://github.com/Mr-MRF-Dev/Py-Bg-Changer.git
    

    or use GitHub CLI

    gh repo clone Mr-MRF-Dev/Py-Bg-Changer
    
  2. Change your directory.

    cd Py-Bg-Changer
    
  3. Install it with uv

    uv tool install --editable .
    

    --editable means any change you make to the code is used right away. Leave it out for a normal install, or use pip install . if you prefer pip.

  4. Check that it works

    pbc --version
    

Done :)

to remove it later: uv tool uninstall py-bg-changer (your saved wallpapers and config stay where they are).

💡 Tips

  • Running pbc from Win+R opens a terminal that closes right away. Use pbcw (or py-bg-changer-w) instead: it takes the same arguments, opens no window, and shows a small message box only if something goes wrong.

    pbcw night
    

    it prints nothing on success, so use pbc in a terminal for list, default and the like.

  • pbc random sets one of your saved wallpapers at random. It skips images whose file is missing, and (when you have more than one) it never picks the image that is set right now, so you always get a change. To know that, the last image set is remembered in the config file under current. It works from Win+R too: pbcw random.

  • On Linux with a bare X11 window manager (i3, bspwm, ...) install feh (sudo pacman -S feh on Arch). feh remembers the last wallpaper in ~/.fehbg, so add ~/.fehbg & to your window manager's startup to get it back after a restart.

  • A wallpaper can have as many aliases as you like, and every alias works anywhere a name does (pbc n, pbc default n, pbc alias n moon). Removing an alias leaves the wallpaper alone; removing a wallpaper also removes its aliases. Renaming a wallpaper keeps its aliases, its image and its place as the default.

  • When you save an image, py-bg-changer keeps its own copy next to the config file and gives that copy to the system. If you later move or delete the original, the wallpaper still works. The copy is removed when you remove the name (or replace its image), and your original file is never touched.

  • Saved names live in a small JSON file, and the copied images in a wallpapers folder next to it. Run pbc path to see where, or set PBC_CONFIG to use a different file.

    {
      "wallpapers": {
        "night": "/home/me/.config/py-bg-changer/wallpapers/3e23e8160039594a.png"
      },
      "aliases": { "n": "night", "dark": "night" },
      "default": "night"
    }
    

🖥️ Supported Desktops

OS Notes
Windows Built in, nothing extra needed
macOS Built in (uses osascript)
Linux GNOME, Budgie, Cinnamon, MATE, KDE Plasma, XFCE and Sway work out of the box. Anything else (i3, bspwm, ...) falls back to feh or nitrogen if installed (X11 only; other Wayland desktops are not supported yet).

👨‍💻 Development

the project is managed with uv:

uv sync              # create the virtualenv and install everything
uv run pytest        # run the tests
uv run pbc --help    # run the CLI from source

🤝 Contributing

we welcome any contributions you may have. If you're interested in helping out, fork the repository and create an Issue and PR.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for py-bg-changer 1.1.1

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

Source distribution (sdist)

Source distribution for py-bg-changer 1.1.1
File Size Uploaded Provenance
py_bg_changer-1.1.1.tar.gz 12.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for py-bg-changer 1.1.1
File Interpreter ABI Platform
py_bg_changer-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 27.6 kB

Release files / py_bg_changer-1.1.1.tar.gz

Download URL py_bg_changer-1.1.1.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
31ccfc01a89c6578b716be1160661637c89427e7e620389d19213e2587c95613
BLAKE2b-256 checksum
How to use checksums
9dbdad994fae36c589a5ee196cb0dc0d3640ddee2a827052b1025c8c0c9e57fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","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}

Release files / py_bg_changer-1.1.1-py3-none-any.whl

Download URL py_bg_changer-1.1.1-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3dd38f949c85631541c8c678356c0dbfd8f256412c580a7d6b508a9924b35c7c
BLAKE2b-256 checksum
How to use checksums
af4ef1d080f2b8d6f18fa0bcb8539d662c7d0054d622e970d6bb2ed3ce499197
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","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}

Security for py-bg-changer 1.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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