autostart webbrowser if logged in on /dev/tty1
This commit is contained in:
@@ -24,3 +24,12 @@ boxweb() {
|
||||
}
|
||||
|
||||
. ~/.config/linse_profile
|
||||
|
||||
if [[ "$(tty)" == "/dev/tty1" && -z "$(pgrep wayfire)" ]]; then
|
||||
echo "desktop is not running, try to start it"
|
||||
python ~/boxtools/wait_websocket.py
|
||||
if [[ -z "$(pgrep wayfire)" ]]; then
|
||||
echo "start desktop (wayfire)"
|
||||
wayfire
|
||||
fi
|
||||
fi
|
||||
|
||||
15
wait_websocket.py
Normal file
15
wait_websocket.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import time
|
||||
import socket
|
||||
|
||||
show = True
|
||||
for _ in range(30):
|
||||
try:
|
||||
socket.create_connection(('localhost', 8010), timeout=1)
|
||||
break
|
||||
except Exception as e:
|
||||
time.sleep(1)
|
||||
if show:
|
||||
print('waiting for frappy websocket')
|
||||
show = False
|
||||
else:
|
||||
print('failed')
|
||||
Reference in New Issue
Block a user