Skip to content

Linux time annoucing script similar to OS X clock feature

Notifications You must be signed in to change notification settings

yllekz/talking-clock

 
 

Repository files navigation

talking-clock, next-generation

Grandfather/wall clock emulator script

From here on out, I'm intending to focus on the PowerShell version of this script due to scripting language preference + cross-compatibility. The bash script will remain but I do not plan to backport new features to it.

Changes/Improvements from the original/other forks

  • Make the script's default actions nonverbal chimes.
  • Easy-to-read instructions on how to install/use
  • Bugfix: Bash script didn't correctly point to the wav files
  • Integrate recordings of the UNH Thompson Hall Clock chimes
    • bang.wav replaced (original is bang-bak.wav)
  • Plays chimes based on Westminster Chimes cadence
  • Integrate recordings of various Sessions/Seth Thomas wall clock sounds
  • Second hand sounds

Installation/Use

talking-clock:
-f [n]
    n: 5, 15, 30 ( min frequency )
    by default it plays chimes on Westminster cadence (short chime on 15/30/45 minutes past the hour) and will play a clock bell striking sound x times based on the hour.
-s
    stops clock
#Linux:
# Pull down the code to your local system:
sudo git clone https://github.com/yllekz/talking-clock /usr/share/talking-clock
# Download + extract the "sound" folder out of the 7z archive in the below link to /usr/share/talking-clock/source:
# https://1drv.ms/f/s!Arp9XZavoR5Hh5o8uNphnHL-5MIFfg?e=Vqgwtd

# Make script executable:
sudo chmod +x /usr/share/talking-clock/source/talking-clock
sudo chmod +x /usr/share/talking-clock/source/talking-clock-ps.ps1

# Linux - If you like bash - run the bash script:
cd /usr/share/talking-clock/source && ./talking-clock

# Linux - If you like PowerShell - run the PowerShell script:
cd /usr/share/talking-clock/source && pwsh -file ./talking-clock-ps.ps1
#or:
cd /usr/share/talking-clock/source && pwsh -file ./talking-clock-ps.ps1 -ChimeStartHr 9 -ChimeEndHr 17 -Freq 30 -SecondHnd 0 -BgChime 1 -SmlChime 1

######

# macOS:
# Same instructions as Linux!

######

# Windows:
# clone this repo to ANY file location you wish
# Download + extract the "sound" folder out of the 7z archive in the below link to the cloned repo folder's "source" folder:
# https://1drv.ms/f/s!Arp9XZavoR5Hh5o8uNphnHL-5MIFfg?e=Vqgwtd
# run talking-clock-ps.ps1
# Same file switches/arguments as Linux/macOS apply here.

Compatibility

  • Tested and working on Linux Mint Cinnamon 20.2 [bash and PowerShell]
    • Requires PowerShell if using the PowerShell script
  • PowerShell script tested and working on Windows 10 via PowerShell 7.
  • Bash script tested with inconclusive results on Windows 10 via Ubuntu on Windows Subsystem for Linux (need to run this as a prereq: sudo apt install alsa-utils)
    • While the script itself will execute just fine, I ran into issues with aplay not finding the sound card. This article might help but it's quite a setup that isn't really worth it.
    • As a workaround, I ported of the Bash script to PowerShell, using .NET invocations to play the chimes. Check out the "talking-clock-ps.ps1" file if you want to use this on Windows, as this will work. It's not a one-to-one port, but the fundamentals are there.

Notes

  • 2024-01-24: The wav files are no longer included in this repository. See above instructions for downloading.
  • By default, the Bash script will run in the background and write the time (every 60 seconds) to console you invoked it on (if you left it open).
  • By default, the Bash script looks for wav files in /usr/share/talking-clock/source/sound/_.wav
  • At the top of the hour, a full chime will play
  • If using the Bash script, to see if it's running: ps -aux | grep talking
    • Or open htop and search for talking-clock if ps does not show it.
  • If using the Bash script, to end it: killall talking-clock
  • If using the PowerShell script on Linux, to end it, find the PID via ps -aux then use the kill command on its ID. Example: kill 48204

TODO:

  • [from original repo] consider replacing aplay with play from sox package for volume control option.
  • [from original repo] fix config file issue
  • [from original repo] update grep usage with if

About

Linux time annoucing script similar to OS X clock feature

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 52.8%
  • Shell 47.2%