summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/font-size.nix
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2018-04-17 20:30:45 +0200
committerjeschli <jeschli@gmail.com>2018-04-17 20:30:45 +0200
commit537806ba0f3043d31e0b4c10edb8b6ba035d9dad (patch)
tree64ebd7d443b97c6d8ec34132f40d864e2a0c179f /krebs/5pkgs/simple/font-size.nix
parent511b45543ad8a0a135425c71108c6907180444d5 (diff)
parent554026a7796e59fcbc82fa44c11636e56a25a9f2 (diff)
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'krebs/5pkgs/simple/font-size.nix')
-rw-r--r--krebs/5pkgs/simple/font-size.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/krebs/5pkgs/simple/font-size.nix b/krebs/5pkgs/simple/font-size.nix
new file mode 100644
index 000000000..21097ed6a
--- /dev/null
+++ b/krebs/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
+''