Skip to content

Instantly share code, notes, and snippets.

@ZiTAL
Last active May 8, 2025 13:40
Show Gist options
  • Save ZiTAL/879547b1605a7a1371b93017f8d68acf to your computer and use it in GitHub Desktop.
Save ZiTAL/879547b1605a7a1371b93017f8d68acf to your computer and use it in GitHub Desktop.
bash: Greenwich Time Signal
0 * * * * /home/zital/scripts/bash/time-signal.sh
#!/bin/bash
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
AUDIO="${DIR}/time-signal.ogg"
DEVICE="alsa_output.usb-GeneralPlus_USB_Audio_Device-00.analog-stereo"
paplay --device=${DEVICE} ${AUDIO}
#!/bin/bash
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
# wget "https://upload.wikimedia.org/wikipedia/commons/0/0f/Gts_%28bbc%29_pips.ogg"
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
AUDIO="${DIR}/time-signal.ogg"
# aplay -l
DEVICE="hw:0,1"
cvlc --play-and-exit --alsa-audio-device ${DEVICE} ${AUDIO}
#!/bin/bash
# echo $DISPLAY
# export DISPLAY=:1.0
# echo $XAUTHORITY
# export XAUTHORITY=/run/user/1000/gdm/Xauthority
# wget "https://upload.wikimedia.org/wikipedia/commons/0/0f/Gts_%28bbc%29_pips.ogg"
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
AUDIO="${DIR}/time-signal.ogg"
COMMAND="ffplay -nodisp -autoexit ${AUDIO}"
${COMMAND}
@ZiTAL
Copy link
Author

ZiTAL commented May 8, 2025

mplayer:

mplayer -ao pulse time-signal.ogg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment