]> git.sur5r.net Git - i3/i3/blob - i3-sensible-pager
Merge branch 'master' into next
[i3/i3] / i3-sensible-pager
1 #!/bin/sh
2 #
3 # This code is released in public domain by Han Boetes <han@mijncomputer.nl>
4
5 # This script tries to exec a pager by trying some known pagers if $PAGER is
6 # not set.
7 #
8 # Distributions/packagers can enhance this script with a
9 # distribution-specific mechanism to find the preferred pager.
10
11 # Hopefully one of these is installed (no flamewars about preference please!):
12 # We don't use 'more' because it will exit if the file is too short.
13 # Worst case scenario we'll open the file in your editor.
14 for pager in $PAGER less most w3m i3-sensible-editor; do
15     if which $pager > /dev/null 2>&1; then
16         exec $pager "$@"
17     fi
18 done