From 774ead6705e4751ad63193ac2ec1f74a205925f0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Oct 2024 19:37:06 +0200 Subject: [PATCH] updates --- autostart.desktop | 5 ----- quotes.py | 19 ++++++++++++------- restart.sh | 3 --- 3 files changed, 12 insertions(+), 15 deletions(-) delete mode 100644 autostart.desktop delete mode 100755 restart.sh diff --git a/autostart.desktop b/autostart.desktop deleted file mode 100644 index 8d9ee0a..0000000 --- a/autostart.desktop +++ /dev/null @@ -1,5 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Quotes -Exec=alacritty -e ~/quotes_display/start.sh -Hidden=true diff --git a/quotes.py b/quotes.py index 537daaa..a34ba02 100644 --- a/quotes.py +++ b/quotes.py @@ -59,10 +59,15 @@ with Live( ) as live: first_it = True while True: - quotes = refresh_quotes() - for _ in range(500): - for q in render_quote(random.choice(quotes) if not first_it else quotes[-1]): - live.update(q) - time.sleep(0.05) - time.sleep(30) - first_it = False + try: + quotes = refresh_quotes() + for _ in range(500): + for q in render_quote(random.choice(quotes) if not first_it else quotes[-1]): + live.update(q) + time.sleep(0.05) + time.sleep(30) + first_it = False + except KeyboardInterrupt: + # Ctrl-C reloads, kill me with Ctrl-\ + first_it = True + pass diff --git a/restart.sh b/restart.sh deleted file mode 100755 index 23203b2..0000000 --- a/restart.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -pkill i3 -kill -HUP $(pgrep -t tty1 bash)