2023-07-11 06:48:53 +00:00
|
|
|
"""
|
|
|
|
* Author: "PepDebian(peppermintosteam@proton.me)
|
|
|
|
*
|
|
|
|
* License: SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*
|
|
|
|
* This file is used to keep functions that are used for the Welcome
|
|
|
|
* Screen
|
|
|
|
"""
|
|
|
|
import os.path
|
2024-07-01 04:30:52 +00:00
|
|
|
import shutil
|
2023-07-11 06:48:53 +00:00
|
|
|
# This will get the logged in user
|
|
|
|
gusr = os.getlogin()
|
|
|
|
spath = "/home/" + gusr + "/.local/share/pmostools/peptools"
|
|
|
|
|
2024-06-21 08:09:24 +00:00
|
|
|
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/"
|
|
|
|
)
|
2024-07-01 04:30:52 +00:00
|
|
|
|
|
|
|
if shutil.which('firefox'):
|
|
|
|
command = (
|
|
|
|
f'firefox -P firefox_kumo --profile "{profile_path}" {run_addrs} &'
|
|
|
|
)
|
|
|
|
print("Found the FF, running Firefox")
|
|
|
|
else:
|
|
|
|
print("Firefox not found, running with luakit instead")
|
|
|
|
command = f'luakit -U {run_addrs} &'
|
2024-06-15 13:16:24 +00:00
|
|
|
else:
|
2024-06-21 08:09:24 +00:00
|
|
|
command = f'luakit -U {run_addrs} &'
|
|
|
|
print("This is a 32bit Flagship with no browser")
|
|
|
|
return command
|
2024-06-15 13:16:24 +00:00
|
|
|
|
|
|
|
|
2023-07-11 06:48:53 +00:00
|
|
|
def suggested_packages():
|
|
|
|
""" Open the suggested packages """
|
|
|
|
os.system('python3 ' + spath + '/suggested.py')
|
|
|
|
|
2024-06-15 13:16:24 +00:00
|
|
|
|
2024-05-17 00:19:15 +00:00
|
|
|
def about():
|
|
|
|
"""Open the about page"""
|
2024-06-21 08:09:24 +00:00
|
|
|
run_addrs = "https://peppermintos.com/about/"
|
|
|
|
command = determine_browser(run_addrs)
|
|
|
|
if command:
|
|
|
|
os.system(command)
|
|
|
|
else:
|
|
|
|
print("There no suitebable browser installed!")
|
2023-07-11 06:48:53 +00:00
|
|
|
|
|
|
|
|
2024-05-17 00:19:15 +00:00
|
|
|
##SSB's###
|
2023-07-11 06:48:53 +00:00
|
|
|
def pep_docs():
|
|
|
|
"""Open Pep Docs"""
|
2024-06-21 08:09:24 +00:00
|
|
|
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!")
|
2023-07-11 06:48:53 +00:00
|
|
|
|
2024-05-17 00:19:15 +00:00
|
|
|
# Community Section
|
2023-07-11 06:48:53 +00:00
|
|
|
def mastodon():
|
|
|
|
"""Open Mastodon"""
|
2024-06-21 08:09:24 +00:00
|
|
|
run_addrs = "https://fosstodon.org/@peppermintos"
|
|
|
|
command = determine_browser(run_addrs)
|
|
|
|
if command:
|
|
|
|
os.system(command)
|
|
|
|
else:
|
|
|
|
print("There no suitebable browser installed!")
|
2023-07-11 06:48:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
def code_berg():
|
|
|
|
"""Open Codeberg"""
|
2024-06-21 08:09:24 +00:00
|
|
|
run_addrs = "https://codeberg.org/Peppermint_OS"
|
|
|
|
command = determine_browser(run_addrs)
|
|
|
|
if command:
|
|
|
|
os.system(command)
|
|
|
|
else:
|
|
|
|
print("There no suitebable browser installed!")
|
2023-07-11 06:48:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
def matrix():
|
|
|
|
"""Open Matrix"""
|
2024-06-21 08:09:24 +00:00
|
|
|
run_addrs = "https://matrix.to/#/!JhPtEbNexzFaoOkvGp:matrix.org?via=matrix.org"
|
|
|
|
command = determine_browser(run_addrs)
|
|
|
|
if command:
|
|
|
|
os.system(command)
|
|
|
|
else:
|
|
|
|
print("There no suitebable browser installed!")
|
2023-07-11 06:48:53 +00:00
|
|
|
|
|
|
|
def source_forge():
|
|
|
|
"""Open Sourceforge"""
|
2024-06-21 08:09:24 +00:00
|
|
|
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!")
|
2023-07-11 06:48:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
def build_date():
|
|
|
|
"""Open BuildDate wiki"""
|
2024-06-21 08:09:24 +00:00
|
|
|
run_addrs = "https://sourceforge.net/p/peppermintos/pepwiki/BuildDate/"
|
|
|
|
command = determine_browser(run_addrs)
|
|
|
|
if command:
|
|
|
|
os.system(command)
|
|
|
|
else:
|
|
|
|
print("There no suitebable browser installed!")
|