Last active
December 13, 2024 08:29
-
-
Save dee-me-tree-or-love/c50068682aaf9c5ba771fc54853f048f to your computer and use it in GitHub Desktop.
Sends out a current time notification on a Linux based platform (tested on Fedora) ⌚️
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
| import datetime | |
| import subprocess | |
| def send_message(message): | |
| subprocess.Popen(['notify-send', str(message)]) | |
| return | |
| def print_message(message): | |
| print(str(message)) | |
| return | |
| def show_time(outputs): | |
| current_time = datetime.datetime.now() | |
| for output in outputs: | |
| output(current_time) | |
| return | |
| if __name__=="__main__": | |
| show_time([print_message, send_message]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment