summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/simple/font-size.nix
blob: 21097ed6a3dc5bf9aca460e234a285deeb2ff799 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
''