Flash And Fade DEMO For Mac OSX 10.7.5, (And Linux?).
This is an AT A GLANCE shell DEMO that does:-
1) 10 centred greyscale fades without warning beeps.
2) 5 centred yellow "WARNING!" flashes with beeps every ON state.
3) 5 FULL widowed red "DANGER!!!" flashes with beeps in the ON and OFF states.
It assumes that the warning bell is enabled inside the terminal.
It is primarily for OSX 10.7.5 and above but it could just as easily work in Linux or other UNIX like systems. It is issued as Public Domain and you my do with it as you please...
READ THE CODE FOR MORE INFO...
(Watch for wordwrapping, etc...)
Bazza, G0LCU...
Code:
#!/bin/bash
#
# Flash and fade for a Macbook Pro OSX 2.7.5 Terminal...
# A DEMO to show how to give an AT A GLANCE, and, audible warning of impending doom in a shell script.
# It is for something like an analogue Data Logger input say from an Arduino analogue source.
#
# It may well work on other Linux and Unix like machines but is untested and uses the "tput" command
# to hide and unhide the terminal cursor. The command "setterm" is commented out and could be used
# in place of the above depending on the *NIX flavour...
#
# Written in such a way that anyone can understand how it works.
#
# It starts with 10 cycles of grey/gray scale fading on a black background without any beeps then next
# 5 yellow warning flashes with a beep every full flash and finally 5 FULL screen red flashes with beeps
# on every ON and OFF state.
#
# Clear a screen to white on black...
printf "\033[0;37;40m"
clear
printf "\n Flash and fade for a default Macbook Pro OSX 2.7.5 Terminal.\n"
# Turn the cursor off...
#setterm -cursor off
tput civis
# Fade on and off 10 times, grey/gray scales on black.
for fade in $(seq 1 10)
do
printf "\033[12;23f\033[1;30;40mFading using four _shades_ of grey...\033[0m"
sleep 0.1
printf "\033[12;23f\033[1;90;40mFading using four _shades_ of grey...\033[0m"
sleep 0.1
printf "\033[12;23f\033[1;37;40mFading using four _shades_ of grey...\033[0m"
sleep 0.1
printf "\033[12;23f\033[1;97;40mFading using four _shades_ of grey...\033[0m"
sleep 0.1
printf "\033[12;23f\033[1;37;40mFading using four _shades_ of grey...\033[0m"
sleep 0.1
printf "\033[12;23f\033[1;90;40mFading using four _shades_ of grey...\033[0m"
sleep 0.1
done
# Over-write the above with the same line again but with black foreground and background colo(u)rs.
printf "\033[12;23f\033[1;30;40mFading using four _shades_ of grey...\033[0m"
# Now flash a YELLOW warning line with beeps for 5 times.
for flash in $(seq 1 5)
do
printf "\033[12;37f\033[0;93;40mWARNING!\033[0m\a"
sleep 0.5
printf "\033[12;37f\033[0;30;103mWARNING!\033[0m"
sleep 0.5
done
# Finally a full window flash with _continuous_ beeps.
for fullflash in $(seq 1 5)
do
printf "\033[1;91;40m"
clear
printf "\033[12;36f\033[1;91;40mDANGER!!!\a"
sleep 0.5
printf "\033[0;30;101m"
clear
printf "\033[12;36f\033[1;30;101mDANGER!!!\a"
sleep 0.5
done
# Reset the cursor back on...
#setterm -cursor on
tput cnorm
# Reset the terminal colo(u)rs back to the defaults...
printf "\033[0m"
clear
printf "\n \$VER: Fade.sh_Version_0.00.10_Public_Domain_2012_B.Walker_G0LCU.\n\n"
# Fade.sh DEMO end...
# Enjoy finding simple solutions to often very difficult problems...
Hey guyz,
Is it possible to build user-mode linux kernel on MAC OSX?
Please I need a reply asap as I have an assignment that I need to do.
Thanks!
Adel (1 Reply)
Hello,
I was wondering about my Cron Script:
HELL=/bin/tcsh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
HOME=/var/log
MAILTO=jwillis
25 1 * * * root /Users/jwillis/Fbcmd\Scripts/DailyBirthday.scrmy returned message is:
Subject: Cron <jwillis@Macintosh-66> root ... (1 Reply)
I'm currently looking for an emulation program that would allow me to open and run osx app.s and programs on a windows xp based system.
if not is there a unix/linux/lindows program that may do the same? (3 Replies)
I finally broke down and decided to buy a new piece of hardware. I think I made the right decision when I chose an Apple iBook - OSX is incredible! I haven't used a Mac since System7.5, and 10.2 is just blowing me away!
Best of all, it's easy to use for people who are not used to Mac, but if I... (5 Replies)
Please help if you are familiar with Mac OSX. I downloaded OpenSSH for a newer version of SSH than what comes with OS 10.1. What a mistake! Now every time I try to make a connection to my remote server I get an message that ssh was built against version such and such and I have version such and... (2 Replies)
Hello, I'm like most people who post here, I'm new in UNIX. Yesterday I installed Xwindows on my OSX box just to learn as much about UNIX as I can. I been messing around with my terminal and conf files that have to do with Apache and sendmail and didn't mess anything up so I thought I was ready to... (2 Replies)
Hi.
Is it possible to execute a Cocoa (or Carbon or eaven a classic) program for mac OSX in the terminal window?
OSX finder can sometimes be so busy that it wont respond for several minutes, ie if you are uploading a very big file/files to a afp server. Then it would have been nice to start... (7 Replies)
To anyone that has the answer:
What does UNIX have that Mac OSX doesn't. I am a programmer, and I am wondering if I could just get Mac OSX for my programming needs instead of UNIX. But my major question is what does UNIX have that Mac OSX doesn't. Thank you if you have the answer, and are willing... (2 Replies)