GiftZwergrapper GiftZwergrapper - 6 months ago 23
Bash Question

Is there a way to program a simple screen magnifier on linux?

I wondered if there is a way of writing a simple screen magnifier for linux?
I thought of a shell script or something like that.

Answer

I found a solution myself with writing a shell script for this purpose, for all interested, this script only depends on feh and scrot:

#!/bin/sh
# Written by Stefan Völkl

if ! hash scrot 2>/dev/null && hash feh 2>/dev/null
then
  echo "You need to have scrot and feh installed"
  exit 1
fi

IMAGE="$(mktemp --tmpdir="/tmp" magnified_XXXXX.png)"
trap 'rm "$IMAGE"' EXIT

scrot "$IMAGE"
feh --borderless --image-bg black --fullscreen "$IMAGE"