pager: expose utilities
This commit is contained in:
parent
1ce5e46e7b
commit
e26b6d1f15
@ -1,36 +1,42 @@
|
|||||||
{ pkgs }:
|
{ pkgs }:
|
||||||
|
|
||||||
pkgs.writeDashBin "pager" ''
|
pkgs.symlinkJoin {
|
||||||
# usage: pager {view,shift,shiftview}
|
name = "pager-wrapper";
|
||||||
#
|
paths = [
|
||||||
# Environment variables
|
(pkgs.writeDashBin "pager" ''
|
||||||
#
|
# usage: pager {view,shift,shiftview}
|
||||||
# PAGER_NAME (default: Pager)
|
#
|
||||||
# The environment variables specifies the application name under which
|
# Environment variables
|
||||||
# resources are to be obtained. PAGER_NAME should not contain “.” or “*”
|
#
|
||||||
# characters.
|
# PAGER_NAME (default: Pager)
|
||||||
#
|
# The environment variables specifies the application name under
|
||||||
set -efu
|
# which resources are to be obtained. PAGER_NAME should not contain
|
||||||
|
# “.” or “*” characters.
|
||||||
|
#
|
||||||
|
set -efu
|
||||||
|
|
||||||
pidfile=$XDG_RUNTIME_DIR/pager.lock
|
pidfile=$XDG_RUNTIME_DIR/pager.lock
|
||||||
name=''${PAGER_NAME-Pager}
|
name=''${PAGER_NAME-Pager}
|
||||||
|
|
||||||
if test -e "$pidfile" &&
|
if test -e "$pidfile" &&
|
||||||
${pkgs.procps}/bin/pgrep --pidfile="$pidfile" >/dev/null
|
${pkgs.procps}/bin/pgrep --pidfile="$pidfile" >/dev/null
|
||||||
then
|
then
|
||||||
${pkgs.procps}/bin/pkill --pidfile="$pidfile"
|
${pkgs.procps}/bin/pkill --pidfile="$pidfile"
|
||||||
${pkgs.coreutils}/bin/rm "$pidfile"
|
${pkgs.coreutils}/bin/rm "$pidfile"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $$ > "$pidfile"
|
echo $$ > "$pidfile"
|
||||||
|
|
||||||
exec ${pkgs.xterm}/bin/xterm \
|
exec ${pkgs.xterm}/bin/xterm \
|
||||||
-name "$name" \
|
-name "$name" \
|
||||||
-ti vt340 \
|
-ti vt340 \
|
||||||
-xrm 'Pager*geometry: 32x10' \
|
-xrm 'Pager*geometry: 32x10' \
|
||||||
-xrm 'Pager*internalBorder: 2' \
|
-xrm 'Pager*internalBorder: 2' \
|
||||||
-xrm 'Pager*background: #050505' \
|
-xrm 'Pager*background: #050505' \
|
||||||
-xrm 'Pager*foreground: #d0d7d0' \
|
-xrm 'Pager*foreground: #d0d7d0' \
|
||||||
-e ${pkgs.haskellPackages.pager}/bin/pager "$@"
|
-e ${pkgs.haskellPackages.pager}/bin/pager "$@"
|
||||||
''
|
'')
|
||||||
|
pkgs.haskellPackages.pager
|
||||||
|
];
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user