summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs/simple/font-size.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-03-27 21:34:05 +0200
committerlassulus <lassulus@lassul.us>2018-03-27 21:34:05 +0200
commit28a597345107e458b95b62671af423ae369e234e (patch)
tree8e5c803609488b4c52ceff0369ab7b888c644389 /tv/5pkgs/simple/font-size.nix
parentdb37440bbb468e6ebdafc2de1d07872f0f726501 (diff)
parent2cc1d9a54eaf512a2fddb57990df3462931990a4 (diff)
Merge remote-tracking branch 'ni/nixpkgs-18.03-fix-strip' into staging/18.03
Diffstat (limited to 'tv/5pkgs/simple/font-size.nix')
-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
+''