Last active
May 8, 2025 13:40
-
-
Save ZiTAL/879547b1605a7a1371b93017f8d68acf to your computer and use it in GitHub Desktop.
bash: Greenwich Time Signal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 * * * * /home/zital/scripts/bash/time-signal.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mplayer: