- Update `x11/hsetroot' to version 1.0.5

- Adds -root parameter, to treat the whole desktop as one display,
  applying the image over the whole, instead of per each display
- No longer depends on xrandr(1) in the run-time

Found out via:	repology.org
This commit is contained in:
Alexey Dokuchaev 2020-04-16 09:16:53 +00:00
parent 9aec26f259
commit 5cd5946c8f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=531832
5 changed files with 18 additions and 41 deletions

View file

@ -2,7 +2,7 @@
# $FreeBSD$ # $FreeBSD$
PORTNAME= hsetroot PORTNAME= hsetroot
PORTVERSION= 1.0.3 PORTVERSION= 1.0.5
CATEGORIES= x11 CATEGORIES= x11
MAINTAINER= danfe@FreeBSD.org MAINTAINER= danfe@FreeBSD.org
@ -11,15 +11,14 @@ COMMENT= Wallpaper manipulation utility for X11
LICENSE= GPLv2 LICENSE= GPLv2
LIB_DEPENDS= libImlib2.so:graphics/imlib2 LIB_DEPENDS= libImlib2.so:graphics/imlib2
RUN_DEPENDS= xrandr:x11/xrandr
USE_GITHUB= yes USE_GITHUB= yes
GH_ACCOUNT= himdel GH_ACCOUNT= himdel
USES= gmake pkgconfig xorg USES= gmake pkgconfig xorg
USE_XORG= x11 USE_XORG= x11 xinerama
PLIST_FILES= bin/hsetroot PLIST_FILES= bin/hsetroot bin/hsr-outputs
PORTDOCS= README.md PORTDOCS= README.md
OPTIONS_DEFINE= DOCS OPTIONS_DEFINE= DOCS

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1561725415 TIMESTAMP = 1573816181
SHA256 (himdel-hsetroot-1.0.3_GH0.tar.gz) = ab40a7723080f72bbaf55be546c62f69d5e73d3ccdfa8bb7b6995e8c1798242a SHA256 (himdel-hsetroot-1.0.5_GH0.tar.gz) = cff5f83b85a21e0c5c8c8eecbd552090bb75d8ac59e27b0bae48046f9cb5a44a
SIZE (himdel-hsetroot-1.0.3_GH0.tar.gz) = 6509 SIZE (himdel-hsetroot-1.0.5_GH0.tar.gz) = 12878

View file

@ -1,22 +1,12 @@
--- Makefile.orig 2019-06-28 12:36:55 UTC --- Makefile.orig 2019-11-15 11:09:41 UTC
+++ Makefile +++ Makefile
@@ -18,16 +18,16 @@ LDFLAGS+=$(shell $(PKG_CONFIG) x11 --libs) @@ -30,8 +30,7 @@ hsetroot: hsetroot.o
CFLAGS+=$(shell $(PKG_CONFIG) imlib2 --cflags) hsr-outputs: hsr-outputs.o
LDFLAGS+=$(shell $(PKG_CONFIG) imlib2 --libs)
+all: hsetroot install: hsetroot hsr-outputs
+ - install -st $(PREFIX)/bin/ hsetroot
hsetroot: hsetroot.o outputs_xrandr.o - install -st $(PREFIX)/bin/ hsr-outputs
hsetroot.o: hsetroot.c outputs.h
-outputs.o: outputs.c outputs.h
-
outputs_xrandr.o: outputs_xrandr.c outputs.h
install: hsetroot
- install -st /usr/local/bin/ hsetroot
+ $(BSD_INSTALL_PROGRAM) $^ $(DESTDIR)$(PREFIX)/bin + $(BSD_INSTALL_PROGRAM) $^ $(DESTDIR)$(PREFIX)/bin
clean: clean:
rm -f hsetroot *.o rm -f *.o hsetroot hsr-outputs

View file

@ -32,7 +32,7 @@
- for (int i = 0; i < noutputs; i++) { - for (int i = 0; i < noutputs; i++) {
+ for (i = 0; i < noutputs; i++) { + for (i = 0; i < noutputs; i++) {
OutputInfo o = outputs[i]; XineramaScreenInfo o = outputs[i];
printf("output %d: size(%d, %d) pos(%d, %d)\n", i, o.w, o.h, o.x, o.y); printf("output %d: size(%d, %d) pos(%d, %d)\n", i, o.w, o.h, o.x, o.y);
@@ -229,6 +230,20 @@ load_image(ImageMode mode, const char *arg, int alpha, @@ -229,6 +230,20 @@ load_image(ImageMode mode, const char *arg, int alpha,
@ -41,16 +41,16 @@
} }
+ } else if (mode == Sane) { + } else if (mode == Sane) {
+ int newW, newH; + int newW, newH;
+ double aspect_w = ((double) o.w) / imgW; + double aspect_w = ((double) o.width) / imgW;
+ double aspect_h = ((double) o.h) / imgH; + double aspect_h = ((double) o.height) / imgH;
+ if (aspect_h < aspect_w) { + if (aspect_h < aspect_w) {
+ // image is taller + // image is taller
+ newW = o.w; + newW = o.width;
+ newH = (int) (imgH * aspect_w); + newH = (int) (imgH * aspect_w);
+ } else { + } else {
+ // image is wider + // image is wider
+ newW = (int) (imgW * aspect_h); + newW = (int) (imgW * aspect_h);
+ newH = o.h; + newH = o.height;
+ } + }
+ imlib_blend_image_onto_image(buffer, 0, 0, 0, imgW, imgH, 0, 0, newW, newH); + imlib_blend_image_onto_image(buffer, 0, 0, 0, imgW, imgH, 0, 0, newW, newH);
} else { // Center || Tile } else { // Center || Tile

View file

@ -1,12 +0,0 @@
--- outputs_xrandr.c.orig 2016-02-14 00:09:11 UTC
+++ outputs_xrandr.c
@@ -31,7 +31,8 @@ OutputInfo
close(pipefd[0]);
dup2(pipefd[1], STDOUT_FILENO);
- system("xrandr | grep ' connected' | sed -e 's/^.*\\s\\+\\([0-9]\\+x[0-9]\\+[-+][0-9]\\+[-+][0-9]\\+\\)\\s\\+.*$/\\1/'");
+ //system("xrandr | grep ' connected' | gsed -e 's/^.*\\s\\+\\([0-9]\\+x[0-9]\\+[-+][0-9]\\+[-+][0-9]\\+\\)\\s\\+.*$/\\1/'");
+ system("xrandr | grep ' connected' | sed -E -e 's/^.*[[:blank:]]+([0-9]+x[0-9]+[-+][0-9]+[-+][0-9]+)[[:blank:]]+.*$/\\1/'");
close(pipefd[1]);
_exit(0);