Updated: needed to determin 32 or 64 bit

min is a 64 but browser, so it cananot be on the 32 system
so, the ccb tools that use min also need to still use luakit
Thes changes should correct that for the the archect system

Signed-off-by: debianpepper <pdpdebdevuan@protonmail.com>
This commit is contained in:
debianpepper 2024-06-15 22:16:24 +09:00
parent e96456295d
commit 08edc255ff
9 changed files with 99 additions and 26 deletions

View File

@ -11,6 +11,7 @@ import re
from urllib.parse import urljoin from urllib.parse import urljoin
from tkinter import filedialog from tkinter import filedialog
import sqlite3 import sqlite3
import platform
import tkinter as tk import tkinter as tk
import requests import requests
import ttkbootstrap as ttk 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);""" 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): def download_favicon(url, output_folder=ipath, request_timeout=3):
""" """
This function will try a regex to find and locate the favicon 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') get_icon = icon_value.get("1.0", 'end-1c')
write_path = dpath + get_name + '.desktop' write_path = dpath + get_name + '.desktop'
selected_category_key = categories_reverse[get_local] selected_category_key = categories_reverse[get_local]
browser_type = set_browser()
app_content = f""" app_content = f"""
[Desktop Entry] [Desktop Entry]
Name={get_name} Name={get_name}
Exec= min -U {get_url} Exec={browser_type} -U {get_url}
Icon={get_icon} Icon={get_icon}
Categories={selected_category_key} Categories={selected_category_key}
Type=Application Type=Application
@ -168,9 +183,13 @@ def fill_url_address():
def run_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') 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(): def select_icon():
""" """

View File

@ -7,16 +7,29 @@
* Screen * Screen
""" """
import os.path import os.path
import platform
# This will get the logged in user # This will get the logged in user
gusr = os.getlogin() gusr = os.getlogin()
spath = "/home/" + gusr + "/.local/share/pmostools/peptools" 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(): def suggested_packages():
""" Open the suggested packages """ """ Open the suggested packages """
os.system('python3 ' + spath + '/suggested.py') os.system('python3 ' + spath + '/suggested.py')
def about(): def about():
"""Open the about page""" """Open the about page"""
os.system('min --new-window https://peppermintos.com/about/ &' os.system('min --new-window https://peppermintos.com/about/ &'
@ -24,40 +37,61 @@ def about():
##SSB's### ##SSB's###
def pep_docs(): def pep_docs():
"""Open 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 # Community Section
def mastodon(): def mastodon():
"""Open 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(): def code_berg():
"""Open Codeberg""" """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(): def matrix():
"""Open 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(): def source_forge():
"""Open Sourceforge""" """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(): def build_date():
"""Open BuildDate wiki""" """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)

View File

@ -9,6 +9,7 @@
import os import os
import sqlite3 import sqlite3
import subprocess import subprocess
import platform
import threading import threading
import tkinter as tk import tkinter as tk
import ttkbootstrap as ttk import ttkbootstrap as ttk
@ -30,6 +31,19 @@ BUTTON_TEXT = "Submit"
STYLE_TYPE = "danger" STYLE_TYPE = "danger"
CURSOR_ICON = "hand2" 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, def submit_password(password_entry,
submit_callback): submit_callback):
""" """
@ -284,7 +298,6 @@ def currently_pending_updates(xd_intro):
tree.set(type_node, "count", str(data["count"])) tree.set(type_node, "count", str(data["count"]))
tree.pack(expand=True, fill=tk.BOTH, padx=5.7, pady=5.7) tree.pack(expand=True, fill=tk.BOTH, padx=5.7, pady=5.7)
print("gotyou")
def get_update_records(): def get_update_records():
@ -314,17 +327,22 @@ def wbase(window_object):
def pep_docs(): def pep_docs():
"""Open Pep Docs""" """Open Pep Docs"""
os.system( browser_type = set_browser()
'min --new-window https://peppermint_os.codeberg.page/html/ &' url = "https://peppermint_os.codeberg.page/html/"
command = (
f'{browser_type} --new-window {url} &'
) )
os.system(command)
def source_forge(): def source_forge():
"""Open Sourceforge""" """Open Sourceforge"""
os.system( browser_type = set_browser()
'min --new-window https://sourceforge.net/p/peppermintos/pepos/ & ' 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): 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"""

View File

@ -321,6 +321,8 @@ SERVER_LIST = ('zonefstoolspep\n'
MINI_LIST = ('nano\n' MINI_LIST = ('nano\n'
) )
KDE_LIST = ('sample1\n' KDE_LIST = ('sample1\n'
'sample2\n' 'sample2\n'
) )