From 1407ad3502a7dd46d6e432b7ccc013bc80341bb1 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Apr 2022 22:16:29 +0200 Subject: pager: init at 1.0.0 --- krebs/5pkgs/haskell/pager.nix | 23 +++++++++++++++++++++++ krebs/5pkgs/simple/pager.nix | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 krebs/5pkgs/haskell/pager.nix create mode 100644 krebs/5pkgs/simple/pager.nix (limited to 'krebs') diff --git a/krebs/5pkgs/haskell/pager.nix b/krebs/5pkgs/haskell/pager.nix new file mode 100644 index 000000000..3c9f80466 --- /dev/null +++ b/krebs/5pkgs/haskell/pager.nix @@ -0,0 +1,23 @@ +{ mkDerivation, base, blessings, bytestring, containers +, data-default, hack, lib, optparse-applicative, probability +, scanner, speculate, split, terminal-size, text, unix, X11 +, fetchgit +}: +mkDerivation { + pname = "pager"; + version = "1.0.0"; + src = fetchgit { + url = "https://cgit.krebsco.de/pager"; + sha256 = "1kqd27faxinkwpxancyk0xl6n7ljlc8iqhnnq85l76bk4qi9b45i"; + rev = "f4cdf79bd4a75e9eafe68b9a908f4cc68682b7ef"; + fetchSubmodules = true; + }; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ + base blessings bytestring containers data-default hack + optparse-applicative probability scanner speculate split + terminal-size text unix X11 + ]; + license = lib.licenses.mit; +} diff --git a/krebs/5pkgs/simple/pager.nix b/krebs/5pkgs/simple/pager.nix new file mode 100644 index 000000000..f156f7414 --- /dev/null +++ b/krebs/5pkgs/simple/pager.nix @@ -0,0 +1,34 @@ +{ 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 + + 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 + + echo $$ > "$pidfile" + + exec ${pkgs.xterm}/bin/xterm \ + -name "$name" \ + -ti vt340 \ + -xrm 'Pager*geometry: 32x10' \ + -xrm 'Pager*internalBorder: 2' \ + -e ${pkgs.haskellPackages.pager}/bin/pager "$@" +'' -- cgit v1.2.3 From 941476b492f54890a161d7564736b05f083001ed Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Apr 2022 23:06:12 +0200 Subject: pager: add default fg and bg colors --- krebs/5pkgs/simple/pager.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'krebs') diff --git a/krebs/5pkgs/simple/pager.nix b/krebs/5pkgs/simple/pager.nix index f156f7414..ed740490d 100644 --- a/krebs/5pkgs/simple/pager.nix +++ b/krebs/5pkgs/simple/pager.nix @@ -30,5 +30,7 @@ pkgs.writeDashBin "pager" '' -ti vt340 \ -xrm 'Pager*geometry: 32x10' \ -xrm 'Pager*internalBorder: 2' \ + -xrm 'Pager*background: #050505' \ + -xrm 'Pager*foreground: #d0d7d0' \ -e ${pkgs.haskellPackages.pager}/bin/pager "$@" '' -- cgit v1.2.3