12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #!/bin/bash
- # Coding: utf-8
- # Editor: www.geany.org
- # Created 2017-05-30
- #_sudo_apt_install_
- #_sudo_dpkg_i_ scons
- export XDG_RUNTIME_DIR=/run/user/$(id -u)
- source $HOME/.SCR/lib.sh
- fun_log_dir_create $0 7 1
- fun_speech_time () # напечатать время с разделением на часы, минуты
- {
- if [ $# == "1" ] # если агрумент один
- then
- f_hour=$(($1 / 60)) # полных часов
- f_min=$(($1 % 60)) # остаток минут
- else
- f_hour=$1
- f_min=$2
- fi
- case "$f_min" in
- "0" ) f_min="exactly" ;;
- "1" ) f_min="$f_min minute" ;;
- * ) f_min="$f_min minutes" ;;
- esac
- case "$f_hour" in
- "0" ) f_hour="" ;;
- "1" ) f_hour="$f_hour hour" ;;
- * ) f_hour="$f_hour hours" ;;
- esac
- echo "$f_hour" "$f_min"
- }
- fun_voice ()
- {
- fun_echo_stadia 11 0 ",speech_en.sh $@"
- echo "$(date +%y-%m-%d_%H-%M-%S_%6N) start $@" >> "${tmp1}/${date}"
- play ~/.RES/sounds/Sound_20761.ogg # sound after speech
- echo "$@" | RHVoice-test -v 300 -r 85 -p slt
- # see more profiles ls /usr/local/share/RHVoice/voices/
- echo "$(date +%y-%m-%d_%H-%M-%S_%6N) finish $@" >> "${tmp1}/${date}"
- notify-send -t 10000 -i ~/.RES/icons/vcs-normal.svg "Today $(cat ~/LOG/uptime_counter.sh/time_for_conky)" "$@"
- }
- if [ -n "$1" ]; # lenth of string not null
- then
- case "$1" in
- "ok" ) fun_voice "Operation complited" ;;
- "msg001" ) fun_voice "The time is now $(fun_speech_time $hour_I $mins)" ;; # 12-11h
- "msg002" ) fun_voice "Today uptime is $(fun_speech_time $uptime_in_day)" ;;
- "msg003" ) fun_voice "Сurrent session uptime is $(fun_speech_time $uptime)" ;;
- "msg004" ) fun_voice "The time is now $(fun_speech_time $hour $mins)" ;; # 0-23h
- * ) fun_voice "$@" ;; # default speech
- esac
- fi
|