Updated: Fixed browsers in the xDaily gui

Thanks! to Manual for the catch

Signed-off-by: debianpepper <pdpdebdevuan@protonmail.com>
This commit is contained in:
debianpepper 2024-06-28 16:46:03 +09:00
parent 534bf77914
commit ff104ff89a
2 changed files with 39 additions and 22 deletions

View File

@ -31,17 +31,33 @@ BUTTON_TEXT = "Submit"
STYLE_TYPE = "danger" STYLE_TYPE = "danger"
CURSOR_ICON = "hand2" CURSOR_ICON = "hand2"
def set_browser(): gusr = os.getlogin()
"""
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
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, def submit_password(password_entry,
@ -327,22 +343,23 @@ def wbase(window_object):
def pep_docs(): def pep_docs():
"""Open Pep Docs""" """Open Pep Docs"""
browser_type = set_browser() run_addrs = "https://peppermint_os.codeberg.page/html/"
url = "https://peppermint_os.codeberg.page/html/" command = determine_browser(run_addrs)
command = ( if command:
f'{browser_type} --new-window {url} &' os.system(command)
) else:
os.system(command) print("There no suitebable browser installed!")
def source_forge(): def source_forge():
"""Open Sourceforge""" """Open Sourceforge"""
browser_type = set_browser() run_addrs = "https://sourceforge.net/p/peppermintos/pepos/"
url ="https://sourceforge.net/p/peppermintos/pepos/" command = determine_browser(run_addrs)
command = ( if command:
f'{browser_type} --new-window {url} &' os.system(command)
) else:
os.system(command) print("There no suitebable browser installed!")
def manage_updates_tab(main_notebook, output_text, run_task_updates,xd_intro, manage_updates): def manage_updates_tab(main_notebook, output_text, run_task_updates,xd_intro, manage_updates):
""" Move to the manage updates tab""" """ Move to the manage updates tab"""