all repos — zenUtils @ 2c5bc6f971854b54e5f5de56efc358edf1e2644f

misc utilities for computing zen

dynacal.sh (raw)

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
27
28
29
#!/bin/sh

# display arvelie/neralie or gregorian time depending on toggle
# Derek Stevens <nilix@nilfm.cc>
# MIT License

if [ "$1" = "-t" ]; then
  current=$(cat ~/.time_mode)
  case ${current} in
    "common")
      echo "regular" > ~/.time_mode
      ;;
    *)
      echo "common" > ~/.time_mode
      ;;
  esac
fi

if [ -z "$1" ]; then
  mode=$(cat ~/.time_mode)
  case ${mode} in
    "regular")
      echo "[$(neralie)]"
      ;;
    *)
      echo "[$(date +"%F %H:%M")]"
      ;;
  esac
fi