~mark/.config/bash/
cd ..
cat top_right_indicator
#!/bin/bash
# reads lines from stdin and displays the most recent
# line in the terminal's first row and last columns.
#
# example usage:
# while true; do date; sleep 1; done | ./top_right_indicator
IFS=''
AWIDTH=0
while read -r DISPLAY_STRING; do
PWIDTH=$AWIDTH
AWIDTH=${#DISPLAY_STRING}
WIDTH=$(( PWIDTH > AWIDTH ? PWIDTH : AWIDTH ))
TARGET_COLUMN=$(($(tput cols)-$WIDTH))
tput sc
tput cup 0 $TARGET_COLUMN
printf '%'"$WIDTH"'s' "$DISPLAY_STRING"
tput rc
done
cat top_right_indicator_time_and_ram
#!/bin/bash
while true; do
printf ' %s, %sGB \n' \
"$(date '+%H:%M:%S')" \
"$(printf 'scale=2; %s/1024/1024' "$(cat /proc/meminfo | grep -i 'MemAvailable.*kB' | grep -oE '[01-9]+')" | bc)"
sleep 1
done | ./top_right_indicator