77
88running_processes = []
99last_launch_times = {}
10-
1110apps = {
1211 'steam' : {'command' : ['flatpak' , 'run' , 'com.valvesoftware.Steam' , '-gamepadui' ], 'flatpak' : True , 'requires_internet' : True , 'title_name' : 'Steam' },
1312 'heroic' : {'command' : ['flatpak' , 'run' , 'com.heroicgameslauncher.hgl' ], 'flatpak' : True , 'requires_internet' : True , 'title_name' : 'Heroic Games Launcher' },
@@ -70,30 +69,24 @@ def launch_app(app_name, main_window):
7069 QMessageBox .warning (None , "Warning" , get_text ('launch_cooldown' , {'seconds' : remaining , 'app' : app_name }))
7170 logging .info (f'Launch blocked for { app_name } due to cooldown: { remaining } s' )
7271 return
73-
7472 app = apps .get (app_name )
7573 if not app :
7674 logging .error (f'Unknown app: { app_name } ' )
7775 return
78-
7976 if not check_app_installed (app ['command' ], app_name ):
8077 return
81-
8278 if app ['requires_internet' ] and not check_internet ():
8379 QMessageBox .warning (None , "Warning" , get_text ('no_internet' ))
8480 logging .error (f'No internet for { app_name } ' )
8581 return
86-
8782 main_window .hide ()
8883 logging .info (f'Launching { app_name } ' )
8984 env = os .environ .copy ()
9085 env ['XDG_SESSION_TYPE' ] = 'wayland'
9186 proc = subprocess .Popen (app ['command' ], env = env )
9287 running_processes .append ((app_name , proc ))
9388 last_launch_times [app_name ] = current_time
94-
9589 QTimer .singleShot (3000 , lambda : set_fullscreen (app_name , app ['title_name' ]))
96-
9790 def check_process ():
9891 if proc .poll () is not None :
9992 logging .info (f'{ app_name } closed' )
@@ -105,7 +98,6 @@ def check_process():
10598 logging .error (f'Error restoring fullscreen for Hacker Mode: { err } ' )
10699 return
107100 QTimer .singleShot (1000 , check_process )
108-
109101 QTimer .singleShot (1000 , check_process )
110102
111103def system_action (action , main_window = None ):
0 commit comments