diff --git a/iso_configs/pmostools/peptools/__pycache__/bsconf.cpython-311.pyc b/iso_configs/pmostools/peptools/__pycache__/bsconf.cpython-311.pyc new file mode 100644 index 00000000..a781d424 Binary files /dev/null and b/iso_configs/pmostools/peptools/__pycache__/bsconf.cpython-311.pyc differ diff --git a/iso_configs/pmostools/peptools/__pycache__/welconf.cpython-311.pyc b/iso_configs/pmostools/peptools/__pycache__/welconf.cpython-311.pyc new file mode 100644 index 00000000..e170d28f Binary files /dev/null and b/iso_configs/pmostools/peptools/__pycache__/welconf.cpython-311.pyc differ diff --git a/iso_configs/pmostools/peptools/__pycache__/welfunc.cpython-311.pyc b/iso_configs/pmostools/peptools/__pycache__/welfunc.cpython-311.pyc new file mode 100644 index 00000000..0ce6dfba Binary files /dev/null and b/iso_configs/pmostools/peptools/__pycache__/welfunc.cpython-311.pyc differ diff --git a/iso_configs/pmostools/peptools/__pycache__/xdaily_functions.cpython-311.pyc b/iso_configs/pmostools/peptools/__pycache__/xdaily_functions.cpython-311.pyc new file mode 100644 index 00000000..39d41c49 Binary files /dev/null and b/iso_configs/pmostools/peptools/__pycache__/xdaily_functions.cpython-311.pyc differ diff --git a/iso_configs/pmostools/peptools/__pycache__/xdailyconf.cpython-311.pyc b/iso_configs/pmostools/peptools/__pycache__/xdailyconf.cpython-311.pyc new file mode 100644 index 00000000..5b02c716 Binary files /dev/null and b/iso_configs/pmostools/peptools/__pycache__/xdailyconf.cpython-311.pyc differ diff --git a/iso_configs/pmostools/peptools/kumo.py b/iso_configs/pmostools/peptools/kumo.py index e06c0f2a..90ee01ca 100755 --- a/iso_configs/pmostools/peptools/kumo.py +++ b/iso_configs/pmostools/peptools/kumo.py @@ -11,6 +11,7 @@ import re from urllib.parse import urljoin from tkinter import filedialog import sqlite3 +import platform import tkinter as tk import requests import ttkbootstrap as ttk @@ -43,6 +44,19 @@ pcur.execute(""" CREATE TABLE IF NOT EXISTS kumoapp (id integer PRIMARY KEY AUTOINCREMENT, ssbname text, lnk text);""" ) +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 + + + def download_favicon(url, output_folder=ipath, request_timeout=3): """ This function will try a regex to find and locate the favicon @@ -115,10 +129,11 @@ def make_desktop_file(): get_icon = icon_value.get("1.0", 'end-1c') write_path = dpath + get_name + '.desktop' selected_category_key = categories_reverse[get_local] + browser_type = set_browser() app_content = f""" [Desktop Entry] Name={get_name} - Exec= min -U {get_url} + Exec={browser_type} -U {get_url} Icon={get_icon} Categories={selected_category_key} Type=Application @@ -168,9 +183,13 @@ def fill_url_address(): def run_url_address(): - """ Run the ssb with the run button""" + """Run the ssb with the run button""" + browser_type = set_browser() run_addrs = runaddr_value.get("1.0", 'end-1c') - os.system('min -U ' + run_addrs + ' &') + command = ( + f'{browser_type} -U {run_addrs} &' + ) + os.system(command) def select_icon(): """ diff --git a/iso_configs/pmostools/peptools/welfunc.py b/iso_configs/pmostools/peptools/welfunc.py index 4b41fe28..30e41f19 100644 --- a/iso_configs/pmostools/peptools/welfunc.py +++ b/iso_configs/pmostools/peptools/welfunc.py @@ -7,16 +7,29 @@ * Screen """ import os.path - +import platform # This will get the logged in user gusr = os.getlogin() spath = "/home/" + gusr + "/.local/share/pmostools/peptools" +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 + + def suggested_packages(): """ Open the suggested packages """ os.system('python3 ' + spath + '/suggested.py') + def about(): """Open the about page""" os.system('min --new-window https://peppermintos.com/about/ &' @@ -24,40 +37,61 @@ def about(): ##SSB's### - def pep_docs(): """Open Pep Docs""" - os.system('min --new-window https://peppermint_os.codeberg.page/html/ &' - ) + browser_type = set_browser() + url = "https://peppermint_os.codeberg.page/html/" + command = ( + f'{browser_type} --new-window {url} &' + ) + os.system(command) # Community Section - - def mastodon(): """Open Mastodon""" - os.system('min --new-window https://fosstodon.org/@peppermintos &' - ) + browser_type = set_browser() + url ="https://fosstodon.org/@peppermintos" + command = ( + f'{browser_type} --new-window {url} &' + ) + os.system(command) def code_berg(): """Open Codeberg""" - os.system('min --new-window https://codeberg.org/Peppermint_OS & ' - ) + browser_type = set_browser() + url ="https://codeberg.org/Peppermint_OS" + command = ( + f'{browser_type} --new-window {url} &' + ) + os.system(command) def matrix(): """Open Matrix""" - os.system('min --new-window https://matrix.to/#/!JhPtEbNexzFaoOkvGp:matrix.org?via=matrix.org & ' - ) + browser_type = set_browser() + url ="https://matrix.to/#/!JhPtEbNexzFaoOkvGp:matrix.org?via=matrix.org" + command = ( + f'{browser_type} --new-window {url} &' + ) + os.system(command) def source_forge(): """Open Sourceforge""" - os.system('min --new-window https://sourceforge.net/p/peppermintos/pepos/ & ' - ) + browser_type = set_browser() + url ="https://sourceforge.net/p/peppermintos/pepos/" + command = ( + f'{browser_type} --new-window {url} &' + ) + os.system(command) def build_date(): """Open BuildDate wiki""" - os.system('min --new-window https://sourceforge.net/p/peppermintos/pepwiki/BuildDate/ & ' - ) + browser_type = set_browser() + url ="https://sourceforge.net/p/peppermintos/pepwiki/BuildDate/" + command = ( + f'{browser_type} --new-window {url} &' + ) + os.system(command) diff --git a/iso_configs/pmostools/peptools/xdaily_functions.py b/iso_configs/pmostools/peptools/xdaily_functions.py index 25db86b5..570eb3b2 100644 --- a/iso_configs/pmostools/peptools/xdaily_functions.py +++ b/iso_configs/pmostools/peptools/xdaily_functions.py @@ -9,6 +9,7 @@ import os import sqlite3 import subprocess +import platform import threading import tkinter as tk import ttkbootstrap as ttk @@ -30,6 +31,19 @@ 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 + + + def submit_password(password_entry, submit_callback): """ @@ -284,7 +298,6 @@ def currently_pending_updates(xd_intro): tree.set(type_node, "count", str(data["count"])) tree.pack(expand=True, fill=tk.BOTH, padx=5.7, pady=5.7) - print("gotyou") def get_update_records(): @@ -314,17 +327,22 @@ def wbase(window_object): def pep_docs(): """Open Pep Docs""" - os.system( - 'min --new-window https://peppermint_os.codeberg.page/html/ &' + browser_type = set_browser() + url = "https://peppermint_os.codeberg.page/html/" + command = ( + f'{browser_type} --new-window {url} &' ) + os.system(command) def source_forge(): """Open Sourceforge""" - os.system( - 'min --new-window https://sourceforge.net/p/peppermintos/pepos/ & ' - ) - + browser_type = set_browser() + url ="https://sourceforge.net/p/peppermintos/pepos/" + command = ( + f'{browser_type} --new-window {url} &' + ) + os.system(command) def manage_updates_tab(main_notebook, output_text, run_task_updates,xd_intro, manage_updates): """ Move to the manage updates tab""" diff --git a/python_modules/conf.py b/python_modules/conf.py index 503f2824..80e32bc6 100644 --- a/python_modules/conf.py +++ b/python_modules/conf.py @@ -321,6 +321,8 @@ SERVER_LIST = ('zonefstoolspep\n' MINI_LIST = ('nano\n' ) + + KDE_LIST = ('sample1\n' 'sample2\n' )