summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs/simple
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
commit0e17cf0119bf833fb046eb28f0656a9083a99a08 (patch)
treeda64478d3fccdf132aebb43dbed715c0e94ce600 /tv/5pkgs/simple
parentdaf27f09bdb59ce7faf5f27cee387d227e08ddea (diff)
tv pkgs: init font-size
Diffstat (limited to 'tv/5pkgs/simple')
-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 0000000..21097ed
--- /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
+''