dotfiles

regexghost dotfiles and scripts
git clone https://git.regexghost.com/dotfiles.git
Log | Files | Refs | README

commit fe472d12019ee939ca986563856f5b31616ec143
parent 1aee933a68aa5f8a53aaf7d1acbc13b5691856a0
Author: regexghost <dev@regexghost.com>
Date:   Fri, 31 Jul 2026 19:20:37 +0100

seperate date-time and calendar scripts, same content as old .kshrc functions

Diffstat:
Mterminal-scripts/Makefile | 2++
Aterminal-scripts/calendar.sh | 28++++++++++++++++++++++++++++
Aterminal-scripts/date-time.sh | 9+++++++++
3 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/terminal-scripts/Makefile b/terminal-scripts/Makefile @@ -42,3 +42,5 @@ normal: cp blog-devlog.sh ${BIN}/blog-devlog cp howlongtobeat.py ${TERMINAL}/howlongtobeat.py cp files.sh ${BIN}/files + cp calendar.sh ${BIN}/calendar + cp date-time.sh ${BIN}/date-time diff --git a/terminal-scripts/calendar.sh b/terminal-scripts/calendar.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +MAGENTA_COLOUR='\033[0;35m\033[1m' +RED_COLOUR='\033[0;34m\033[1m' +BLUE_COLOUR='\033[0;36m\033[1m' +RESET_COLOUR='\033[0m' + +suffix () { + if [ "$1" = "1" ] || [ "$1" = "21" ] || [ "$1" = "31" ]; then + echo "st" + elif [ "$1" = "2" ] || [ "$1" = "22" ]; then + echo "nd" + elif [ "$1" = "3" ] || [ "$1" = "23" ]; then + echo "rd" + else + echo "th" + fi +} + +unbuffer cal -w -n 3 "$@" | sed '/^ *$/d' + +day="$(date +'%A')" +date="$(date +'%d')" +week="$(date +'%V')" + +echo "${RED_COLOUR}Day:${RESET_COLOUR} ${day}" +echo "${BLUE_COLOUR}Date:${RESET_COLOUR} ${date}$(suffix $date)" +echo "${MAGENTA_COLOUR}Week:${RESET_COLOUR} ${week}" diff --git a/terminal-scripts/date-time.sh b/terminal-scripts/date-time.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +TZ="America/Los_Angeles" date +"Los Angeles: %H:%M:%S - %a, %b %d (%Z)" +TZ="America/New_York" date +"New York: %H:%M:%S - %a, %b %d (%Z)" +date -u +"UTC: %H:%M:%S - %a, %b %d (%Z)" +TZ="Europe/London" date +"London: %H:%M:%S - %a, %b %d (%Z)" +TZ="Europe/Paris" date +"Paris: %H:%M:%S - %a, %b %d (%Z)" +TZ="Asia/Seoul" date +"Seoul: %H:%M:%S - %a, %b %d (%Z)" +TZ="Australia/Sydney" date +"Sydney: %H:%M:%S - %a, %b %d (%Z)"