2022-05-22 18:38:43 +02:00
|
|
|
#!/bin/env python3
|
|
|
|
import time
|
|
|
|
import os
|
|
|
|
|
2022-08-13 22:31:19 +02:00
|
|
|
# exit()
|
|
|
|
|
2022-05-22 18:38:43 +02:00
|
|
|
def notify_fail():
|
2022-08-13 22:31:19 +02:00
|
|
|
os.system('notify-send "Restarting SteamVR" "<VR game>" died again :(" --icon /home/crispypin/pictures/emotes/screech.gif')
|
2022-05-22 18:38:43 +02:00
|
|
|
|
|
|
|
def notify_ok():
|
2022-08-13 22:31:19 +02:00
|
|
|
os.system('notify-send "Go play <VR game>" "It stayed open for 150s" --icon /home/crispypin/pictures/emotes/frogchamp.png')
|
2022-05-22 18:38:43 +02:00
|
|
|
|
|
|
|
STATUSFILE = "/tmp/VRC_RUNNING"
|
|
|
|
|
|
|
|
is_ok = True
|
|
|
|
for i in range(150):
|
|
|
|
time.sleep(1)
|
|
|
|
if not os.path.isfile(STATUSFILE):
|
|
|
|
is_ok = False
|
|
|
|
break
|
|
|
|
|
|
|
|
if is_ok:
|
|
|
|
notify_ok()
|
|
|
|
exit()
|
|
|
|
else:
|
|
|
|
notify_fail()
|
|
|
|
|
|
|
|
## restart steam
|
|
|
|
os.system("killall vrmonitor")
|
2022-08-13 22:31:19 +02:00
|
|
|
time.sleep(5)
|
2022-05-22 18:38:43 +02:00
|
|
|
# start steamvr
|
|
|
|
os.system("steam steam://rungameid/250820")
|
|
|
|
# start vrchat
|
2022-05-28 14:13:11 +02:00
|
|
|
# time.sleep(7)
|
|
|
|
# os.system("steam steam://rungameid/438100")
|