Multilingual Spoken Startup Welcome Plus Internet Alarm

Window managers, icon programs, widgets, etc.
Post Reply
Message
Author
User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

Multilingual Spoken Startup Welcome Plus Internet Alarm

#1 Post by ETP »

Multilingual Spoken Startup Welcome Plus Internet Connection alarm

This .pet (startup_welcome_alert-mk1) provides a verbal multilingual welcome plus an alarm should a working internet connection not have been established.

The spoken welcome varies according to the time of day & the script also verifies that a working Internet connection exists.
If it does not, an alarm will sound instead of the welcome.
Both the greeting and the alarm are supplemented by on-screen messages in English.

Only a single mp3 audio file is included in the .pet for the alarm, everything else including translation is handled by TTS.
This pet is suitable for use with recent WoofCE Pups and has been tested with 666philb's Bionicpup64 7.9.8 CE RC & 8.0

Installation:

1. Use ppm to install xdotool & mpv if not currently present.

2. Use ppm to install translate-shell_0.9.6.6-1 plus it's dependencies.

3. Install the attached pet, then reboot ensuring that you save the session.The pet will activate following a further reboot & save.

Final thoughts & additional info:

A. Whilst Google Translate is used as the default translation engine other engines may be specified:-
  • root# trans -S
    aspell
    * google
    deepl
    bing
    spell
    hunspell
    apertium
    yandex
    root#
B. The language code used for speech is extracted automatically from your settings variable($LANG). See shot below for a complete list in English of codes.

C. No browsers are involved in this process.

D. The text to be spoken can easily be changed. In addition once you have translate-shell installed you can issue spoken messages from either
the command line or from within any script, perhaps to warn of impending meltdown or lack of free memory.
A simple example CLI command follows which will be translated from English text and spoken in French.

Code: Select all

trans -b -p en: :fr "Good day Wee Hamish","Internet access is confirmed. Would you like to play the square game?"
E. In conclusion loads of fun plus multiple potential uses. (trans -h for help)

EDIT: 10th June 2020

The latest mk6 pet issued on 10th June 2020 can be found HERE.
Attachments
startup_welcome_alert-mk1.pet
Issued 5th February 2019
(161.87 KiB) Downloaded 460 times
lang-codes.png
(237.17 KiB) Downloaded 1067 times
Main_script _in_pet.png
(74.29 KiB) Downloaded 1086 times
Last edited by ETP on Wed 10 Jun 2020, 14:51, edited 10 times in total.
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

foxpup
Posts: 1132
Joined: Fri 29 Jul 2016, 21:08

#2 Post by foxpup »

hello ETP

I've tried it on dPup Stretch from radky and it works.
I find it very nice. It's a good idea. And you are very resourceful.
Thanks! 'll keep it in my toolbox.

I will try out the translation/localisation now.

Edit:
I changed my locale to nl_be. Then on restarting X I got a welcome in dutch, which is right (dutch=nederlands=nl).
Just did not expect it on restarting X as well.

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

Multilingual Spoken Startup Welcome Plus Internet Alarm

#3 Post by ETP »

Hi foxpup,

Thanks for testing and your confirmation that it works in dPup Stretch from radky.
It is intended that it triggers when X is restarted.
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

Multilingual Spoken Startup Welcome Plus Internet Alarm

#4 Post by ETP »

New pet May 2019

The attached startup_welcome_alert-mk2.pet improves on the mk1 version with a couple of extra optional features.

In the original pet the text to be spoken in your native language was as follows:

"Good morning/afternoon/evening, Internet access is confirmed."

In this new version you may also be greeted by a name of your choice and the weekday may also be announced.
Example:

"Good afternoon Steve. Today is Sunday, Internet access is confirmed."

The revised commented main script is reproduced below. In the example above I have simply replaced Root with Steve

If you wish to move to this new version first use PPM to uninstall the mk1 version.

Code: Select all

#!/bin/sh
# This is /root/noob/startup_welcome_alarm.sh    ETP February 2019
# Modified May 2019 to include 2 additional variables (cognomen and day). Either or both lines (6 & 7) may be commented out if not required.
# Please substitute your own desired handle for Root  e.g. Fred (The displayed messages have not been changed.)
#
cognomen=Root;echo $cognomen
day="Today is `date +%A`,";echo $day
check=`date +%H`
echo $check
if [ $check -ge 05 -a $check -le 11 ]

then
        tod="Good morning $cognomen."

elif [ $check -ge 12 -a $check -le 17 ]

then
        tod="Good afternoon $cognomen."
else
        tod="Good evening $cognomen."
fi
player=mpv
alarmclip=/usr/share/audio/no_internet.mp3
#lang=fr # Uncomment for testing only & comment out the following line.
lang=`echo $LANG | cut -d_ -f1`
echo $lang
#
#
sleep 18 # May be reduced from default of 18 seconds to 15 or less if using an SSD or fast HD.  Also if using a static IP rather than DHCP.
echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
if [ $? -eq 0 ]; then
        trans -b -p -player mpv en: :$lang "$tod $day Internet access is confirmed." &
        xdotool mousemove --polar 0 0 mousemove_relative 0  40
        yaf-splash -close never -fontsize large -bg yellow -fg black -timeout 12 -text "   Internet access is confirmed.   "
else 
        yaf-splash -close never -fontsize large -bg red -fg white -timeout 10 -text "---   WARNING: No Internet Connection   ---" &
        $player $alarmclip
fi
Attachments
startup_welcome_alert-mk2.pet
(161.82 KiB) Downloaded 412 times
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

Multilingual Spoken Startup Welcome Plus Internet Alarm

#5 Post by ETP »

Latest pet Dec 2019

The attached startup_welcome_alert-mk4.pet improves on the previous pets with some minor code changes. (The mk3 version was not released)

The revised commented main script is reproduced below.

If you wish to move to this new version, first use PPM to uninstall the mk1 or mk2 version.

Installation instructions remain as detailed in the original post in this thread.

Code: Select all

#!/bin/sh
# This is /root/noob/startup_welcome_alarm.sh    ETP November 2019
# Modified May 2019 to include 2 additional variables (cognomen and day). Either or both lines (6 & 7) may be commented out if not required.
# Please substitute your own desired handle for Root  e.g. Fred (The displayed messages have not been changed.)
#
cognomen=Root;echo $cognomen
day="Today is `date +%A`,";echo $day
check=`date +%H`
echo $check
if [ $check -ge 05 -a $check -le 11 ]

then
        tod="Good morning $cognomen."

elif [ $check -ge 12 -a $check -le 17 ]

then
        tod="Good afternoon $cognomen."
else
        tod="Good evening $cognomen."
fi
player=mpv
alarmclip=/usr/share/audio/no_internet.mp3
#lang=fr # Uncomment for testing only & comment out the following line.
lang=`echo $LANG | cut -d_ -f1`
echo $lang
#
#
sleep 18 # May be reduced from default of 18 seconds to 15 or less if using an SSD or fast HD.  Also if using a static IP rather than DHCP.
echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
if [ $? -eq 0 ]; then
        trans -b -p -player $player en: :$lang "$tod $day Internet access is confirmed." &
        xdotool mousemove --polar 0 0 mousemove_relative 0  40
        yaf-splash -close never -fontsize large -bg yellow -fg black -timeout 12 -text "   Internet access is confirmed.   "
else 
        yaf-splash -close never -fontsize large -bg red -fg white -timeout 10 -text "---   WARNING: No Internet Connection   ---" &
        $player $alarmclip
fi
Attachments
startup_welcome_alert-mk4.pet
(162.06 KiB) Downloaded 244 times
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

Multilingual Spoken Startup Welcome Plus Internet Alarm

#6 Post by ETP »

Latest pet March 2020

The attached startup_welcome_alert-mk5.pet improves on the previous pets with extra code to
add the Pup name and version to the text to be spoken in your native language.

EXAMPLE of spoken welcome u‌sing the official Bionicpup64 8.0.

"Good afternoon Steve. This is bionicpup64, 8.0. Today is Friday and Internet access is confirmed."

Listen to above.

The revised commented main script is reproduced below.

All these pets remain suitable for WoofCE Pups. A custom package for Fatdog has also been issued.

If you wish to move to this new version, first use PPM to uninstall any previous version.

Installation instructions remain as detailed in the original post in this thread together with
additional information.

Code: Select all

#!/bin/sh
# This is /root/noob/startup_welcome_alarm.sh    ETP 6th March 2020
# Please substitute your own desired handle for Root on line 9  (e.g. Fred)
#
#
os=`grep DISTRO_NAME /etc/DISTRO_SPECS | cut -d "'" -f 2`
version=`grep DISTRO_VERSION /etc/DISTRO_SPECS | cut -d "=" -f 2`
distro="This is $os, $version.";echo $distro
cognomen="Root";echo $cognomen
day="Today is `date +%A`";echo $day
check=`date +%H`
echo $check
if [ $check -ge 05 -a $check -le 11 ]

then
        tod="Good morning $cognomen."

elif [ $check -ge 12 -a $check -le 17 ]

then
        tod="Good afternoon $cognomen."
else
        tod="Good evening $cognomen."
fi
player=mpv
alarmclip=/usr/share/audio/no_internet.mp3
#lang=fr # Uncomment for testing only & comment out the following line.
lang=`echo $LANG | cut -d_ -f1`
echo $lang
#
#
sleep 18 # May be reduced from default of 18 seconds to 15 or less if using an SSD or fast HD.  Also if using a static IP rather than DHCP.
echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
if [ $? -eq 0 ]; then
        trans -b -p -player $player en: :$lang "$tod $distro $day and Internet access is confirmed." &
        xdotool mousemove --polar 0 0 mousemove_relative 0  40
        yaf-splash -close never -fontsize large -bg yellow -fg black -timeout 14 -text "   Internet access is confirmed.   "
else 
        yaf-splash -close never -fontsize large -bg red -fg white -timeout 10 -text "---   WARNING: No Internet Connection   ---" &
        $player $alarmclip
fi
Attachments
startup_welcome_alert-mk5.pet
startup_welcome_alert-mk5.pet
(162.05 KiB) Downloaded 178 times
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#7 Post by bigpup »

You really should edit the first post and place the latest pet in it.
There is nothing in that first post to tell people there is a newer version and where it is for download.

If this topic had many pages. You would quickly understand the need to, always have the latest version, in the first post, of the topic.
ETP,
You have total control of what is in that first post.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#8 Post by s243a »

Have you considered, having the start up script give a random Murphy's Law? That would have good nostalgia value for computing! :)
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

#9 Post by ETP »

Hi bigpup,

Thanks for your suggestion. In view of the fact that I have published the changed text of the relevant main script
with each pet version, I prefer in this case to keep them together but do take your point.
I have therefore added a link in the original post.
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

#10 Post by ETP »

s243a wrote:Have you considered, having the start up script give a random Murphy's Law? That would have good nostalgia value for computing! :)
Hi s243a,

Interesting suggestion, probably feasible as a separate optional script called from the end of the startup script.
I have not done anything like that since 2013 when I put a spoken "Message of the Day" into Obedient Pup V3.
See: http://murga-linux.com/puppy/viewtopic. ... 027#734866
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

Multilingual Spoken Startup Welcome Plus Internet Alarm

#11 Post by ETP »

Latest pet June 2020 [mk6]

The attached startup_welcome_alert_covid-mk6.pet improves on the previous pets with an extra option
that appends Covid 19 advice to the text to be spoken in your native language.

EXAMPLE of spoken welcome u‌sing the official Bionicpup64 8.0.

"Good morning Root. This is bionicpup64, 8.0. Today is Wednesday and Internet access is confirmed.
Please stay alert, maintain social distancing and wash your paws regularly."


The revised commented main script is reproduced below.

All of the pets in this thread remain suitable for WoofCE Pups.

If you wish to move to this new version, first use PPM to uninstall any previous version.

If you do not wish to hear the Covid advice, just comment out the covid line at the top of the script.
The text that will then be spoken will be identical to the mk5 example.
Alternatively substitute additional text to be spoken of your own choosing on that line.

Installation instructions remain as detailed in the original post in this thread together with
additional information.
The last 3 videos at the bottom of the following shared album show this latest script in action.

https://tinyurl.com/yad3qbzf

Code: Select all

#!/bin/sh
# This is /root/noob/startup_welcome_alarm.sh    (Covid version) ETP 10th June 2020
# Please substitute your own desired handle for Root on line 10  (e.g. Fred)
#
#
covid="Please stay alert, maintain social distancing and wash your paws regularly."
os=`grep DISTRO_NAME /etc/DISTRO_SPECS | cut -d "'" -f 2`
version=`grep DISTRO_VERSION /etc/DISTRO_SPECS | cut -d "=" -f 2`
distro="This is $os, $version.";echo $distro
cognomen="Root"
echo $cognomen
day="Today is `date +%A`";echo $day
check=`date +%H`
echo $check
if [ $check -ge 05 -a $check -le 11 ]

then
        tod="Good morning $cognomen."

elif [ $check -ge 12 -a $check -le 17 ]

then
        tod="Good afternoon $cognomen."
else
        tod="Good evening $cognomen."
fi
player=mpv
alarmclip=/usr/share/audio/no_internet.mp3
#lang=fr # Uncomment for testing only & comment out the following line.
lang=`echo $LANG | cut -d_ -f1`
echo $lang
echo $covid
#
#
sleep 18 # May be reduced from default of 18 seconds to 15 or less if using an SSD or fast HD.  Also if using a static IP rather than DHCP.
echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
if [ $? -eq 0 ]; then
        trans -b -p -player $player en: :$lang "$tod $distro $day and Internet access is confirmed. $covid" &
        xdotool mousemove --polar 0 0 mousemove_relative 0  40
        yaf-splash -close never -fontsize large -bg yellow -fg black -timeout 18 -text "   Internet access is confirmed.   "
else 
        yaf-splash -close never -fontsize large -bg red -fg white -timeout 10 -text "---   WARNING: No Internet Connection   ---" &
        $player $alarmclip
fi
Attachments
startup_welcome_alert_covid-mk6.pet
(162.21 KiB) Downloaded 111 times
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

Post Reply