termux / termux-api-package

Termux package containing scripts to call functionality in Termux:API.
MIT License
994 stars 314 forks source link

More control over wallpaper [2/2] #154

Open TpmKranz opened 2 years ago

TpmKranz commented 2 years ago

The old implementation allowed only to set one of the two backgrounds at one time, but not both at once.

The Bash part of this is backwards compatible with the old WallpaperAPI implementation, but trying -l home would paradoxically set the lockscreen wallpaper. Cf. https://github.com/termux/termux-api/pull/526 for the Java part.

TpmKranz commented 2 years ago

The old implementation sets the leftmost part of the image as the initially visible area, making it necessary to crop images before handing them over to termux-wallpaper, when that functionality is already provided by the setBitmap method.

The rectangle specification was inspired by ImageMagick, but cut down (and in the case of relative offsets changed) a bit for the specific use case of setting wallpapers.