diff options
author | B. Watson <yalhcru@gmail.com> | 2022-01-10 23:17:28 -0500 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2022-01-17 09:03:28 +0700 |
commit | 725c8bbf4a77331bd0cfb2099ebd4ec7898be40b (patch) | |
tree | 0e8084d7f5213806b083251c67e61308c17aa7fe /accessibility | |
parent | b3365fea47ca902d89a85ec901ae6f2d04b51f89 (diff) |
accessibility/magnus: Added (screen magnifier for X)
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'accessibility')
-rw-r--r-- | accessibility/magnus/README | 5 | ||||
-rw-r--r-- | accessibility/magnus/doinst.sh | 9 | ||||
-rw-r--r-- | accessibility/magnus/magnus.SlackBuild | 112 | ||||
-rw-r--r-- | accessibility/magnus/magnus.info | 10 | ||||
-rw-r--r-- | accessibility/magnus/slack-desc | 19 |
5 files changed, 155 insertions, 0 deletions
diff --git a/accessibility/magnus/README b/accessibility/magnus/README new file mode 100644 index 0000000000000..a830510a6ed67 --- /dev/null +++ b/accessibility/magnus/README @@ -0,0 +1,5 @@ +magnus (a very simple screen magnifier for X11) + +A very simple screen magnifier for visually impaired users. Allows +setting the zoom level to anything between 2x and 5x. May also be +useful for running older X apps on modern high-DPI displays. diff --git a/accessibility/magnus/doinst.sh b/accessibility/magnus/doinst.sh new file mode 100644 index 0000000000000..3e5691a052b5b --- /dev/null +++ b/accessibility/magnus/doinst.sh @@ -0,0 +1,9 @@ +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi diff --git a/accessibility/magnus/magnus.SlackBuild b/accessibility/magnus/magnus.SlackBuild new file mode 100644 index 0000000000000..9beb56657ca6d --- /dev/null +++ b/accessibility/magnus/magnus.SlackBuild @@ -0,0 +1,112 @@ +#!/bin/bash + +# Slackware build script for magnus + +# Written by B. Watson (yalhcru@gmail.com) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# This thing is more flexible and featureful than mag, but slower and +# more resource-intensive (due to being written in python, I guess). + +# Notes: + +# The default refresh interval is 250ms, or 4 frames/sec. This is +# painful to use. On my not-very-powerful machine, 15ms (67fps) is +# fine. I'm patching the code to set the default to 30ms. Also, the +# man page and --help output claim the default is 120ms... + +# This thing draws its own window titlebar and decorations, which look +# and behave different from *everything else* I use. Very annoying, +# and I'm told that's the direction the GTK/Gnome crowd is moving +# towards, especially in GTK+4. + +# The default behaviour is to only update the magnified view when the +# mouse moves, which makes this pretty useless IMO. Upstream added +# a patch in git that adds a --force-refresh option, which makes it +# always update. What I'm doing here: patch it so it always refreshes, +# without having to pass an argument. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=magnus +VERSION=${VERSION:-1.0.3} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ + +# always refresh even if the mouse hasn't moved. +sed -i '/def *poll/s,=False,=True,' $PRGNAM + +# set the default refresh rate to something usable. +REFRESH=${REFRESH:-30} +sed -i -e '/refresh_interval *=/s,250,'$REFRESH',' \ + -e '/--refresh-interval=/s,120,'$REFRESH',' \ + $PRGNAM +sed -i 's,120ms,'$REFRESH',' data/$PRGNAM.1 + +python3 setup.py install --root=$PKG + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README.md LICENSE $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mv $PKG/usr/share/man $PKG/usr/man +gzip -9 $PKG/usr/man/man?/* + +# doesn't ship an icon, expects to uses a system icon called "zoom-best-fit". +# we have such an icon in the elementary-xfce theme, include a symlink here. +mkdir -p $PKG/usr/share/icons/hicolor/48x48/apps +ln -s ../../../elementary-xfce/actions/48/zoom-best-fit.png \ + $PKG/usr/share/icons/hicolor/48x48/apps + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/accessibility/magnus/magnus.info b/accessibility/magnus/magnus.info new file mode 100644 index 0000000000000..6ebcf48255930 --- /dev/null +++ b/accessibility/magnus/magnus.info @@ -0,0 +1,10 @@ +PRGNAM="magnus" +VERSION="1.0.3" +HOMEPAGE="https://github.com/stuartlangridge/magnus/" +DOWNLOAD="https://github.com/stuartlangridge/magnus/archive/1.0.3/magnus-1.0.3.tar.gz" +MD5SUM="53249667de050d930dcde097ff9ee937" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="python-distutils-extra setproctitle" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" diff --git a/accessibility/magnus/slack-desc b/accessibility/magnus/slack-desc new file mode 100644 index 0000000000000..8e16ed211b555 --- /dev/null +++ b/accessibility/magnus/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +magnus: magnus (a very simple screen magnifier for X11) +magnus: +magnus: A very simple screen magnifier for visually impaired users. Allows +magnus: setting the zoom level to anything between 2x and 5x. May also be +magnus: useful for running older X apps on modern high-DPI displays. +magnus: +magnus: +magnus: +magnus: +magnus: +magnus: |