~kaction/savepage

af884e3e9b924fc4358e0634011824dda63258c7 — Dmitry Bogatov 5 months ago 1077ed3 master
Write and install manpage for "fbclear"
3 files changed, 32 insertions(+), 7 deletions(-)

M Makefile
A man/fbclear.txt
M savepage.nix
M Makefile => Makefile +10 -4
@@ 1,8 1,14 @@
.POSIX:
PREFIX = /
all:
install:
	mkdir -p $(DESTDIR)$(PREFIX)/bin
	install -m 755 savepage.exec $(DESTDIR)$(PREFIX)/bin
all: man/fbclear.1
install: all
	mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/share/man/man1
	install -m 755 fbclear.exec $(DESTDIR)$(PREFIX)/bin/fbclear
	install -m 644 man/fbclear.1 $(DESTDIR)$(PREFIX)/share/man/man1

.SUFFIXES:
.SUFFIXES: .txt .1
.txt.1:
	scdoc < $< > $@

.PHONY: all install

A man/fbclear.txt => man/fbclear.txt +19 -0
@@ 0,0 1,19 @@
fbclear(1)

# NAME

fbclear - clear terminal screen after framebuffer program

# SYNOPSIS

fbclear COMMAND [ARG]...

# DESCRIPTION

After command that uses framebuffer directly exits screen retains last
frame shown, and command line appears on top of that last frame, which
looks ugly. Clearing terminal using *clear*(1) mostly works, but leaves
remains on bottom of screen.

Program *fbclear* runs command, fully clears framebuffer after it and
exits with same exit code as command itself.

M savepage.nix => savepage.nix +3 -3
@@ 5,12 5,12 @@ stdenv.mkDerivation {
  src = ./.;
  makeFlags = ["DESTDIR=$(out)"];
  path = lib.makeBinPath [ execline jq busybox ];
  buildInputs = [ execline ];
  buildInputs = [ execline scdoc ];
  installPhase = ''
    mkdir -p $out/bin
    make install DESTDIR=$out
    substituteAll ./savepage.exec $out/bin/savepage
    cp ./fbclear.exec $out/bin/fbclear
    sed -i 's/^##://' $out/bin/savepage
    cp ./fbclear.exec $out/bin/fbclear
    chmod +x $out/bin/*
  '';
}