diff options
author | lassulus <git@lassul.us> | 2023-02-09 09:39:02 +0100 |
---|---|---|
committer | lassulus <git@lassul.us> | 2023-02-09 09:39:02 +0100 |
commit | 4dc160536675b19a6e3029d142e1824f1d5a9272 (patch) | |
tree | e7e9b05b91a893a35ee3000cced81553a574bc48 /krebs/5pkgs/simple/pager.nix | |
parent | 5b768d2b0050507037584f3b7f4a5cf90d627c57 (diff) | |
parent | 9a52edeea22f686c189933de0538ab69a3c054bd (diff) |
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'krebs/5pkgs/simple/pager.nix')
-rw-r--r-- | krebs/5pkgs/simple/pager.nix | 66 |
1 files changed, 36 insertions, 30 deletions
diff --git a/krebs/5pkgs/simple/pager.nix b/krebs/5pkgs/simple/pager.nix index ed740490d..506ef2eb3 100644 --- a/krebs/5pkgs/simple/pager.nix +++ b/krebs/5pkgs/simple/pager.nix @@ -1,36 +1,42 @@ { pkgs }: -pkgs.writeDashBin "pager" '' - # usage: pager {view,shift,shiftview} - # - # Environment variables - # - # PAGER_NAME (default: Pager) - # The environment variables specifies the application name under which - # resources are to be obtained. PAGER_NAME should not contain “.” or “*” - # characters. - # - set -efu +pkgs.symlinkJoin { + name = "pager-wrapper"; + paths = [ + (pkgs.writeDashBin "pager" '' + # usage: pager {view,shift,shiftview} + # + # Environment variables + # + # PAGER_NAME (default: Pager) + # The environment variables specifies the application name under + # which resources are to be obtained. PAGER_NAME should not contain + # “.” or “*” characters. + # + set -efu - pidfile=$XDG_RUNTIME_DIR/pager.lock - name=''${PAGER_NAME-Pager} + pidfile=$XDG_RUNTIME_DIR/pager.lock + name=''${PAGER_NAME-Pager} - if test -e "$pidfile" && - ${pkgs.procps}/bin/pgrep --pidfile="$pidfile" >/dev/null - then - ${pkgs.procps}/bin/pkill --pidfile="$pidfile" - ${pkgs.coreutils}/bin/rm "$pidfile" - exit - fi + if test -e "$pidfile" && + ${pkgs.procps}/bin/pgrep --pidfile="$pidfile" >/dev/null + then + ${pkgs.procps}/bin/pkill --pidfile="$pidfile" + ${pkgs.coreutils}/bin/rm "$pidfile" + exit + fi - echo $$ > "$pidfile" + echo $$ > "$pidfile" - exec ${pkgs.xterm}/bin/xterm \ - -name "$name" \ - -ti vt340 \ - -xrm 'Pager*geometry: 32x10' \ - -xrm 'Pager*internalBorder: 2' \ - -xrm 'Pager*background: #050505' \ - -xrm 'Pager*foreground: #d0d7d0' \ - -e ${pkgs.haskellPackages.pager}/bin/pager "$@" -'' + exec ${pkgs.xterm}/bin/xterm \ + -name "$name" \ + -ti vt340 \ + -xrm '*geometry: 32x10' \ + -xrm '*internalBorder: 2' \ + -xrm '*background: #050505' \ + -xrm '*foreground: #d0d7d0' \ + -e ${pkgs.haskellPackages.pager}/bin/pager "$@" + '') + pkgs.haskellPackages.pager + ]; +} |