diff --git a/iso_configs/pmostools/peptools/__pycache__/xdaily_functions.cpython-311.pyc b/iso_configs/pmostools/peptools/__pycache__/xdaily_functions.cpython-311.pyc index c0e1da99..29f7d5f8 100644 Binary files a/iso_configs/pmostools/peptools/__pycache__/xdaily_functions.cpython-311.pyc and b/iso_configs/pmostools/peptools/__pycache__/xdaily_functions.cpython-311.pyc differ diff --git a/iso_configs/pmostools/peptools/xdaily_functions.py b/iso_configs/pmostools/peptools/xdaily_functions.py index 570eb3b2..ac12761d 100644 --- a/iso_configs/pmostools/peptools/xdaily_functions.py +++ b/iso_configs/pmostools/peptools/xdaily_functions.py @@ -31,17 +31,33 @@ BUTTON_TEXT = "Submit" STYLE_TYPE = "danger" CURSOR_ICON = "hand2" -def set_browser(): - """ - Determine the system and set the browser type - """ - architecture = platform.architecture()[0] - if '64bit' in architecture: - browser_type = "min" - else: - browser_type = "luakit" - return browser_type +gusr = os.getlogin() +def determine_browser(run_addrs): + """ Determine what browser should be used by kumo""" + + lwpath = "/home/" + gusr + "/.local/share/pmostools/lw_profile" + ffpath = "/home/" + gusr + "/.local/share/pmostools/ff_profile" + if os.path.exists(lwpath) and os.path.isdir(lwpath): + profile_path = os.path.expanduser( + f"/home/{gusr}/.local/share/pmostools/lw_profile/" + ) + command = ( + f'librewolf -P kumo --profile "{profile_path}" {run_addrs} &' + ) + print("Found the LW, running LibreWolf") + elif os.path.exists(ffpath) and os.path.isdir(ffpath): + profile_path = os.path.expanduser( + f"/home/{gusr}/.local/share/pmostools/ff_profile/" + ) + command = ( + f'firefox -P firefox_kumo --profile "{profile_path}" {run_addrs} &' + ) + print("Found the FF, running Firefox") + else: + command = f'luakit -U {run_addrs} &' + print("This is a 32bit Flagship with no browser") + return command def submit_password(password_entry, @@ -327,22 +343,23 @@ def wbase(window_object): def pep_docs(): """Open Pep Docs""" - browser_type = set_browser() - url = "https://peppermint_os.codeberg.page/html/" - command = ( - f'{browser_type} --new-window {url} &' - ) - os.system(command) + run_addrs = "https://peppermint_os.codeberg.page/html/" + command = determine_browser(run_addrs) + if command: + os.system(command) + else: + print("There no suitebable browser installed!") def source_forge(): """Open Sourceforge""" - browser_type = set_browser() - url ="https://sourceforge.net/p/peppermintos/pepos/" - command = ( - f'{browser_type} --new-window {url} &' - ) - os.system(command) + run_addrs = "https://sourceforge.net/p/peppermintos/pepos/" + command = determine_browser(run_addrs) + if command: + os.system(command) + else: + print("There no suitebable browser installed!") + def manage_updates_tab(main_notebook, output_text, run_task_updates,xd_intro, manage_updates): """ Move to the manage updates tab"""