Campimeter.sh for macOS

Hi Neo...

This is me too except for the attention span. As soon as I find a solution to something I let others better it.
And as for doing something different I have done some bizarre stuff on here... <wink> /Me awaits the mickey take... ;oD
OT: Here is a small snippet for a terminal window you might like under OSX 10.14.6 on this MBP, solved and going into the Campimeter code.

#!/bin/bash
# Campimeter.sh

clear

# Set terminal to full screen and default sizes.
set_size()
{
    osascript << "FULL_SCREEN"
        tell application "Terminal" to activate
        tell application "System Events" to keystroke "f" using { command down, control down }
        delay 3
FULL_SCREEN
}

initialise()
{
    clear
    printf "%b" "\033[0;30;47m"
    clear
    SIZE=( $( stty size ) )
    VERT_CENTRE=$(( ${SIZE[0]} / 2 ))
    HORIZ_CENTRE=$(( ${SIZE[1]} / 2 ))
    printf "%b" "\033[${VERT_CENTRE};${HORIZ_CENTRE}f\033[0;30;42m  \033[0;30;47m\033[1;1f"
}

set_size

initialise

printf "\033[33;33f\033[1;31;47m*\033[0;30;47m\033[1;1f"

sleep 3

set_size
 

Enjoy...

2 Likes

Hi Wise,

I moved your code to another new topic as it was not directly related to the topic of networking, BLE, NB-IoT or ArduinoBlue where it was originally posted.

Thanks

1 Like

Thanks for sharing nice code wisecracker :b:
Please forgive me if I am wrong here, I believe shebang should be #!/bin/bash right?
Or please correct me if I missed something here, cheers.

Thanks,
R. Singh

1 Like

Ha ha, thanks and corrected post #1...
Barry...

1 Like