summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2018-03-27 20:06:23 +0200
committertv <tv@krebsco.de>2018-03-27 20:10:13 +0200
commitf76401ef002851cca81218de3d879b4829668ebe (patch)
tree609fbe58600199a119fdde0a1adc9133853fe2db
parent6a94383764130a9a28a990d4e1e4413b0bbf3d06 (diff)
tv pkgs: init font-size
-rw-r--r--tv/5pkgs/simple/font-size.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/tv/5pkgs/simple/font-size.nix b/tv/5pkgs/simple/font-size.nix
new file mode 100644
index 000000000..21097ed6a
--- /dev/null
+++ b/tv/5pkgs/simple/font-size.nix
@@ -0,0 +1,26 @@
+{ writeDashBin }:
+writeDashBin "font-size" ''
+ set -efu
+
+ # set_font NORMAL_FONT BOLD_FONT
+ set_font() {
+ printf '\033]710;%s\007' "$1"
+ printf '\033]711;%s\007' "$2"
+ }
+
+ case ''${1-} in
+ '''|0|--reset)
+ set_font \
+ -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1 \
+ -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1 \
+ ;;
+ [1-9]|[1-9][0-9]|[1-9][0-9][0-9])
+ set_font \
+ xft:Monospace:size=$1 \
+ xft:Monospace:size=$1:bold \
+ ;;
+ *)
+ echo "$0: bad argument: $1" >&2
+ exit 1
+ esac
+''