add remove timer.txt after win
This commit is contained in:
@@ -11,7 +11,6 @@ END_STATE = "/home/crime5/.timer/end_state.txt"
|
||||
|
||||
def is_running():
|
||||
result = subprocess.run(["pgrep", "-f", SCRIPT_NAME], stdout=subprocess.PIPE)
|
||||
# print(f"DEBUG: pgrep result: {result.returncode}, stdout: {result.stdout}")
|
||||
return result.returncode == 0
|
||||
|
||||
|
||||
@@ -46,8 +45,14 @@ while True:
|
||||
exit(0)
|
||||
else:
|
||||
print("DEBUG: Win message wird ausgeführt!")
|
||||
try:
|
||||
if os.path.exists(STATE_FILE):
|
||||
os.remove(STATE_FILE)
|
||||
print(f"{STATE_FILE} wurde gelöscht.")
|
||||
except Exception as e:
|
||||
print(f"Fehler beim Löschen von {STATE_FILE}: {e}")
|
||||
subprocess.run(["/usr/local/bin/win-message.sh"])
|
||||
time.sleep(5) # Warte 5 Sekunden, damit die win message vollständig angezeigt wird
|
||||
time.sleep(5)
|
||||
exit(0)
|
||||
|
||||
if os.path.exists(STATE_FILE):
|
||||
|
||||
Reference in New Issue
Block a user