15 lines
548 B
Nix
15 lines
548 B
Nix
{ pkgs, ... }: let
|
|
sep = " ";
|
|
in {
|
|
home.packages = [
|
|
(pkgs.writeShellApplication { name = "cclock"; text = /* bash */ ''
|
|
ord=$(date +"%e" | awk '{printf("%d%s\n", $1, ($1==11||$1==12||$1==13)?"th":((($1%10)==1)?"st":((($1%10)==2)?"nd":((($1%10)==3)?"rd":"th"))))}')
|
|
if [ $# -eq 0 ]; then
|
|
echo "${sep}$(date +'%A the')" "$ord" "of" "$(date +'%B')" " ${sep}$(date +'%R')"
|
|
elif [ "$1" = "--no-icons" ]; then
|
|
echo "$(date +'%A the')" "$ord" "of" "$(date +'%B')" "$(date +'%R')"
|
|
fi
|
|
'';})
|
|
];
|
|
}
|