From 9932a24001e292ed2fe66c32dabc3078514bb80b Mon Sep 17 00:00:00 2001 From: turret Date: Sat, 11 Nov 2023 16:31:43 -0600 Subject: local/bin: add utility scripts on my main box --- .local/bin/timefinder | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 .local/bin/timefinder (limited to '.local/bin/timefinder') diff --git a/.local/bin/timefinder b/.local/bin/timefinder new file mode 100755 index 0000000..2e8544f --- /dev/null +++ b/.local/bin/timefinder @@ -0,0 +1,10 @@ +#!/bin/sh +TIMEZONE=${1:-$(cat /etc/timezone)} + +[ ! -f /usr/share/zoneinfo/${TIMEZONE} ] && echo "invalid zone" && exit 1 + +LOCALE=${2:-en-US} +CHARACTER_SET="[:alnum:]" +read -r -n 10 S < <(LC_ALL=C tr -dc "${CHARACTER_SET}" < /dev/urandom) +echo -n "https://time.turret.cyou/${TIMEZONE}?locale=${LOCALE}&s=${S}" | xclip -in -selection clipboard +xclip -out -selection clipboard && echo -- cgit v1.2.3