{"id":13576766,"url":"https://github.com/xyproto/wallutils","last_synced_at":"2025-05-15T20:04:37.889Z","repository":{"id":41867832,"uuid":"169589601","full_name":"xyproto/wallutils","owner":"xyproto","description":":city_sunset: Utilities for handling monitors, resolutions, wallpapers and timed wallpapers","archived":false,"fork":false,"pushed_at":"2025-04-17T16:31:14.000Z","size":6775,"stargazers_count":494,"open_issues_count":7,"forks_count":17,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-18T06:58:45.298Z","etag":null,"topics":["dpi","freebsd","getdpi","gnome","i3","i3wm","imagemagick","linux","module","plasma","sway","timed-wallpaper","utility","wallpaper","wayland","windowanagers","x11","xorg"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xyproto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-02-07T15:01:22.000Z","updated_at":"2025-04-17T16:31:17.000Z","dependencies_parsed_at":"2024-01-15T22:44:19.917Z","dependency_job_id":"2495cc97-d512-42ea-8894-5ea4da57babd","html_url":"https://github.com/xyproto/wallutils","commit_stats":{"total_commits":480,"total_committers":9,"mean_commits":"53.333333333333336","dds":0.08750000000000002,"last_synced_commit":"b87789e3f24a3aabb5b2326980917d713492ef20"},"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fwallutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fwallutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fwallutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fwallutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xyproto","download_url":"https://codeload.github.com/xyproto/wallutils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414499,"owners_count":22067272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dpi","freebsd","getdpi","gnome","i3","i3wm","imagemagick","linux","module","plasma","sway","timed-wallpaper","utility","wallpaper","wayland","windowanagers","x11","xorg"],"created_at":"2024-08-01T15:01:13.843Z","updated_at":"2025-05-15T20:04:34.646Z","avatar_url":"https://github.com/xyproto.png","language":"Go","readme":"# Wallutils [![Build](https://github.com/xyproto/wallutils/actions/workflows/build.yml/badge.svg)](https://github.com/xyproto/wallutils/actions/workflows/build.yml) [![GoDoc](https://godoc.org/github.com/xyproto/wallutils?status.svg)](http://godoc.org/github.com/xyproto/wallutils) [![License](http://img.shields.io/badge/license-BSD-green.svg?style=flat)](https://raw.githubusercontent.com/xyproto/wallutils/main/LICENSE) [![Go Report Card](https://goreportcard.com/badge/github.com/xyproto/wallutils)](https://goreportcard.com/report/github.com/xyproto/wallutils)\n\n* Detect monitor resolutions and set the desktop wallpaper, for any window manager (please file an issue if your window manager is not supported yet).\n* Supports GNOME timed wallpapers, and includes a utility that can run an event loop for changing them (also supports cross fading).\n* Introduces a new file format for timed wallpapers: The **Simple Timed Wallpaper** format: [Markdown](https://github.com/xyproto/wallutils/blob/main/pkg/simpletimed/stw-1.0.0.md) | [PDF](https://raw.githubusercontent.com/xyproto/wallutils/main/pkg/simpletimed/stw-1.0.0.pdf).\n* GNOME timed wallpapers can be converted to the Simple Timed Wallpaper format with the `xml2stw` utility.\n* macOS dynamic wallpapers (in the HEIF format with the `.heic` extension) can be installed with `heic-install` and used with `lstimed` and `settimed`. This extracts the metadata with `heic2stw` (only timing information, not the azimuth and elevation for the sun, yet) and extracts the images with `convert` that comes with ImageMagick.\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/wallutils.svg)](https://repology.org/project/wallutils/versions)\n\n## Timed Wallpapers\n\nThe [Mojave timed wallpaper](https://github.com/japamax/gnome-mojave-timed-wallpaper) and other timed wallpapers can be set with the `settimed` command, and will cross fade from image to image as the day progresses:\n\n\u003cimg alt=\"Dynamic wallpaper example\" src=\"https://i.redd.it/z5zx32pe3l311.gif\" width=320\u003e\n\nNote that some window managers makes it hard to achieve smooth switches of desktop backgrounds, while others makes it easy.\n\n## Included utilities\n\n  * `getdpi`, for retrieving the average DPI, for all monitors (use `-b` to see the DPI both horizontally and vertically).\n  * `lscollection`, for listing installed wallpaper collections (use `-l` for also listing paths and collection names).\n  * `timedinfo`, for showing more information about installed timed wallpapers.\n  * `lsmon` lists the connected monitors and resolutions that are discovered by the current WM/DE (use `-d` for also listing DPI).\n  * `lstimed` for listing installed timed wallpapers (use `-l` for also listing paths).\n  * `lswallpaper`, for listing all installed wallpapers (use `-l` and `-s` to list more information).\n  * `setcollection`, for setting a suitable (in terms of resolution) wallpaper from a wallpaper collection.\n  * `setrandom`, for setting a random wallpaper.\n  * `settimed`, for setting timed wallpapers (will continue to run, to handle time events). (This utility has recently been refactored and needs more testing).\n  * `setwallpaper` can be used for setting a wallpaper (works both over X and the Wayland protocol).\n  * `wayinfo` shows detailed information about the connected monitors, via Wayland.\n  * `xinfo` shows detailed information about the current X setup.\n  * `xml2stw` for converting GNOME timed wallpapers to the Simple Timed Wallpaper format.\n  * `heic2stw` for extracting the timing information from macOS dynamic wallpapers (`.heic` files) to the Simple Timed Wallpaper format.\n  * `vram` for finding the minimum amount of VRAM available for non-integrated GPUs (use `-l` to list the bus ID, a description and available VRAM for each GPU).\n\n## Included scripts\n\n  * `heic-install` for installing a macOS dynamic wallpaper to `/usr/share/backgrounds` using both ImageMagick `convert` and `heic2stw`.\n\n## Example use of the `lsmon` utility\n\n```sh\n$ lsmon\n0: 1920x1200\n1: 1920x1200\n2: 1920x1200\n```\n\n## Installing `wallutils`\n\n### Arch Linux\n\n    pacman -S wallutils\n\n### Fedora\n\nWith sudo, or as root, install the required dependencies:\n\n    sudo dnf update\n    sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm\n    sudo dnf install git golang ImageMagick libXcursor-devel libXmu-devel xorg-x11-xbitmaps libheif-devel wayland-devel\n\nAs a user, clone the repository and build the utilities:\n\n    git clone https://github.com/xyproto/wallutils\n    cd wallutils\n    make\n\nThen with sudo, or as root, install the utilities:\n\n    sudo make PREFIX=/usr/local install\n\n### Debian 11\n\nWith sudo, or as root, install the required dependencies:\n\n    sudo apt install git golang imagemagick libx11-dev libxcursor-dev libxmu-dev libwayland-dev libxpm-dev xbitmaps libxmu-headers libheif-dev make\n\nAs a user, clone the repository and build the utilities:\n\n    git clone https://github.com/xyproto/wallutils\n    cd wallutils\n    make\n\nThen with sudo, or as root, install the utilities:\n\n    sudo make PREFIX=/usr/local install\n\n## Installing a single utility\n\nUsing Go 1.17 or later, install ie. the `getdpi` utility:\n\n    go install github.com/xyproto/wallutils/cmd/getdpi@latest\n\n## Wayland or X only\n\nThe executables related to X can be removed after building if you only wish to keep the Wayland-related functionality. And the same for Wayland.\n\n## Example use of `settimed`\n\n    settimed mojave-timed\n\n## Example use of `setwallpaper`\n\n    setwallpaper /path/to/background/image.png\n\n## Example use of `setrandom`\n\n    setrandom /usr/share/pixmaps\n\n## Example use of the Go package\n\n### Retrieve monitor resolution(s)\n\n~~~go\npackage main\n\nimport (\n    \"fmt\"\n    \"os\"\n\n    \"github.com/xyproto/wallutils\"\n)\n\nfunc main() {\n    // Retrieve a slice of Monitor structs, or exit with an error\n    monitors, err := wallutils.Monitors()\n    if err != nil {\n        fmt.Fprintf(os.Stderr, \"%s\\n\", err)\n        os.Exit(1)\n    }\n    // For every monitor, output the ID, width and height\n    for _, monitor := range monitors {\n        fmt.Printf(\"%d: %dx%d\\n\", monitor.ID, monitor.Width, monitor.Height)\n    }\n}\n~~~\n\n### Change the wallpaper\n\n```go\nfmt.Println(\"Setting background image to: \" + imageFilename)\nif err := wallutils.SetWallpaper(imageFilename); err != nil {\n    return err\n}\n```\n\n## Build requirements\n\n* Go 1.11 or later. 1.17 or later is recommended.\n* A working C compiler (tested with GCC 8.2.1).\n* Header files for Wayland and X.\n* `libheif` for `heic2stw` and `heic-install`.\n\n## Runtime requirements\n\n* `libwayland-client.so`, for Wayland support.\n* `libX11.so`, for X support.\n* `libheif.so` for HEIF/`.heic` image support.\n\nIt is also possible to build with `make static`, to only build the utilities that does not depend on any of the above `.so` files, as statically compiled ELF executables.\n\n* `swaybg` and `pkill` for Wayland-based window managers like `Labwc`.\n\nThe `vram` utility depends on `lspci` (from `pciutils`) and also `nvidia-smi` for NVIDIA GPUs.\n\n## Wallpaper collections\n\nThe XML format from GNOME for specifying wallpaper **collections** is not yet supported (and I'm not sure if it's needed). Creating a directory with images where the filename of the images specify the resolution (like `wallpaper_5639x3561.jpg`) is enough for `lscollection` to recognize it as a collection (if the directory is placed in `/usr/share/backgrounds` or `/usr/share/wallpapers`).\n\n## Refreshing the wallpaper after waking from sleep\n\nSend the `USR1` signal to the `settimed` process:\n\n    pkill -USR1 settimed\n\nThis should refresh the wallpaper.\n\n## A note about i3\n\n* When using wallutils together with `i3`, it works best with also having `feh` and `imlib2` installed.\n\n## Setting a wallpaper per monitor\n\n* Setting a wallpaper per monitor is not supported, yet. Right now, a wallpaper is set for all monitors. Pull requests are welcome.\n\n## General info\n\n* Author: Alexander F. Rødseth \u0026lt;xyproto@archlinux.org\u0026gt;\n* License: BSD-3\n* Version: 5.12.10\n","funding_links":[],"categories":["Go","Wallpaper"],"sub_categories":["Sway Specific"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxyproto%2Fwallutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxyproto%2Fwallutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxyproto%2Fwallutils/lists"}