~tardypad/dotfiles

ref: 00c0c349a1b8960152233f11caa9ea1a40e395a3 dotfiles/files/scripts/shell/status -rwxr-xr-x 449 bytes
00c0c349 — Damien Tardy-Panis Add presentation mode to mako to hide notifications 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

print_item() {
  HEADER="$1"
  VALUE="$2"

  printf "%s\n" "${HEADER}"
  # shellcheck disable=SC1083
  printf "$(tput setaf {color/base09/number} )%s$(tput sgr0)\n" "${VALUE}"
}

{
  print_item 'User' "${LOGNAME}"
  print_item 'Host' "$(cat /proc/sys/kernel/hostname )"
  print_item 'Dir' "${PWD}"

  if git rev-parse --git-dir > /dev/null 2>&1; then
    print_item 'Branch' "$( git current-branch )"
  fi
} | pr -l1 -s -2 | expand  -t 8