diff options
author | Mateusz Piotrowski <0mp@FreeBSD.org> | 2019-10-31 16:30:52 +0000 |
---|---|---|
committer | Mateusz Piotrowski <0mp@FreeBSD.org> | 2019-10-31 16:30:52 +0000 |
commit | c7aec1489ef4d9fe698731c45c95116e479bd15d (patch) | |
tree | f8d15ae3d19134ec534b5ca8643123f3f3e43848 /x11/run_scaled | |
parent | d23d35ea8b649d4b815980cf81f5e9f00303f9e5 (diff) | |
download | ports-c7aec1489ef4d9fe698731c45c95116e479bd15d.tar.gz ports-c7aec1489ef4d9fe698731c45c95116e479bd15d.zip |
Notes
Diffstat (limited to 'x11/run_scaled')
-rw-r--r-- | x11/run_scaled/Makefile | 32 | ||||
-rw-r--r-- | x11/run_scaled/distinfo | 3 | ||||
-rw-r--r-- | x11/run_scaled/files/patch-run__scaled | 19 | ||||
-rw-r--r-- | x11/run_scaled/pkg-descr | 4 |
4 files changed, 58 insertions, 0 deletions
diff --git a/x11/run_scaled/Makefile b/x11/run_scaled/Makefile new file mode 100644 index 000000000000..7740fc860b38 --- /dev/null +++ b/x11/run_scaled/Makefile @@ -0,0 +1,32 @@ +# $FreeBSD$ + +PORTNAME= run_scaled +DISTVERSION= g20181209 +CATEGORIES= x11 + +MAINTAINER= 0mp@FreeBSD.org +COMMENT= Run an X application scaled via Xpra (useful on HiDPI screens) + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +RUN_DEPENDS= bash:shells/bash \ + xpra:x11/xpra \ + xrandr:x11/xrandr \ + Xvfb:x11-servers/xorg-vfbserver + +USES= shebangfix +USE_GITHUB= yes +GH_ACCOUNT= kaueraal +GH_TAGNAME= 669993429863a9f6aa53560171ef1fc57f8546f9 +SHEBANG_FILES= ${PORTNAME} + +NO_ARCH= yes +NO_BUILD= yes + +PLIST_FILES= bin/${PORTNAME} + +do-install: + ${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin + +.include <bsd.port.mk> diff --git a/x11/run_scaled/distinfo b/x11/run_scaled/distinfo new file mode 100644 index 000000000000..b3b4b4feee6a --- /dev/null +++ b/x11/run_scaled/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1572524979 +SHA256 (kaueraal-run_scaled-g20181209-669993429863a9f6aa53560171ef1fc57f8546f9_GH0.tar.gz) = e9101587c67bf8ae35f400f30428a377e371ca8ff2276069651493f246f90e9d +SIZE (kaueraal-run_scaled-g20181209-669993429863a9f6aa53560171ef1fc57f8546f9_GH0.tar.gz) = 2325 diff --git a/x11/run_scaled/files/patch-run__scaled b/x11/run_scaled/files/patch-run__scaled new file mode 100644 index 000000000000..2a0659ad484b --- /dev/null +++ b/x11/run_scaled/files/patch-run__scaled @@ -0,0 +1,19 @@ +--- run_scaled.orig 2019-10-31 16:00:04 UTC ++++ run_scaled +@@ -65,12 +65,13 @@ done + + declare -i UNSCALED_RESOLUTION_X + declare -i UNSCALED_RESOLUTION_Y +-UNSCALED_RESOLUTION_X=`xrandr | sed -n -e 's/Screen 0:.*current \([0-9]\+\) x \([0-9]\+\).*/\1/p'` +-UNSCALED_RESOLUTION_Y=`xrandr | sed -n -e 's/Screen 0:.*current \([0-9]\+\) x \([0-9]\+\).*/\2/p'` ++UNSCALED_RESOLUTION_X=`xrandr | sed -n -e 's/Screen 0:.*current \([0-9][0-9]*\) x \([0-9][0-9]*\).*/\1/p'` ++UNSCALED_RESOLUTION_Y=`xrandr | sed -n -e 's/Screen 0:.*current \([0-9][0-9]*\) x \([0-9][0-9]*\).*/\2/p'` + + UNSCALED_RESOLUTION="$( bc <<<"$UNSCALED_RESOLUTION_X / $SCALING_FACTOR" )x$( bc <<<"$UNSCALED_RESOLUTION_Y / $SCALING_FACTOR" )" + +-DISPLAYNUM=:`shuf -i 10000-99999999 -n 1` ++# sysutils/shuf is significantly slower than jot(1). ++DISPLAYNUM=:`jot -r 1 10000 99999999` + ESCAPED_PARAMS=`printf '%q ' "$@"` + xpra start "$DISPLAYNUM" --xvfb="Xvfb +extension Composite -screen 0 ${UNSCALED_RESOLUTION}x24+32 -nolisten tcp -noreset -auth \$XAUTHORITY" --env=GDK_SCALE=1 --env=GDK_DPI_SCALE=1 --start-child="$ESCAPED_PARAMS" --exit-with-children + sleep "$SLEEPTIME" diff --git a/x11/run_scaled/pkg-descr b/x11/run_scaled/pkg-descr new file mode 100644 index 000000000000..aabe4f8569a5 --- /dev/null +++ b/x11/run_scaled/pkg-descr @@ -0,0 +1,4 @@ +run_scaled is a Bash script that simplifies scaling graphical X applications on +HiDPI displays (using Xpra). + +WWW: https://github.com/kaueraal/run_scaled |