Various shell scripts for use on the RTC server. Not your official RTC stuff!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

22 lines
642 B

#! /bin/bash
# gemini - Gemini updates selector
# Author: samhunter@rawtext.club
# https://git.rawtext.club/samhunter/rtc-shell-scripts
#
readonly PROGNAME="${0##*/}"
readonly VERSION="1.0.0"
GMIUSER="${1:?"$PROGNAME {user} [{file age in min}]"}"
GMIAGE="${2:-60}"
check_gemini_updates () {
TIM=${2:-60};
[ -n "$1" ] && find /home/$1/public_gemini/ -type f -mmin -$TIM -ls
}
GEMLINK="$(check_gemini_updates $GMIUSER $GMIAGE |fzf +m| awk '{l=$NF; gsub("/home/","gemini://rawtext.club/~",l); gsub("/public_gemini","",l); print l}')"
if [[ -n "$GEMLINK" && -n "$GEMINI" ]] ; then
$GEMINI "$GEMLINK"
else
echo "$GEMLINK"
fi