i3/i3-sensible-pager

16 lines
545 B
Plaintext
Raw Normal View History

#!/bin/sh
# This script tries to exec a pager by trying some known pagers if $PAGER is
# not set.
#
# Distributions/packagers can enhance this script with a
# distribution-specific mechanism to find the preferred pager.
[ -n "$PAGER" ] && which $PAGER >/dev/null && exec $PAGER "$@"
# Hopefully one of these is installed:
which most >/dev/null && exec most "$@"
which less >/dev/null && exec less "$@"
# we don't use 'more' because it will exit if the file is 'too short'
# If no pager is installed, try an editor
exec i3-sensible-editor "$@"