Last active
May 6, 2025 14:23
-
-
Save ZiTAL/8993d5e31c1c9eff4879ec54f234708a to your computer and use it in GitHub Desktop.
gnu/linux bash: close command at date time
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 | |
COMMAND="ffplay https://server5.mediasector.es/listen/bizkaia-irratia-musika/radio.mp3" | |
TIME="16:07" | |
DATE=$(date +%Y-%m-%d) | |
DATE_TIME="${DATE} ${TIME}" | |
SECONDS_UNTIL=$(($(date -d "$DATE_TIME" +%s) - $(date +%s))) | |
timeout "${SECONDS_UNTIL}s" ${COMMAND} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment