Updated: Added librewolf

Signed-off-by: debianpepper <pdpdebdevuan@protonmail.com>
This commit is contained in:
debianpepper 2024-06-20 11:55:53 +09:00
parent 93fd38d957
commit da550b73de
1 changed files with 33 additions and 15 deletions

View File

@ -42,11 +42,10 @@ def remmove_desktop_files():
os.system('rm /usr/share/applications/btop.desktop')
def install_min_browser():
def install_librewolf_browser():
"""
This minimum browser is used for kumo this will download
the .deb install stall the package, then remove the unneeded
files. 64bit only
Installs LibreWolf browser for Kumo by setting up sources and
installing the package.
"""
path_to_file = '/opt/pepconf/'
build_id_list = [
@ -59,19 +58,38 @@ def install_min_browser():
path_to_file + 'deb.64opb',
path_to_file + 'dev.64opb'
]
distro_cmd = (
"distro=$(if echo ' una bookworm vanessa focal jammy bullseye vera uma ' | "
"grep -q ' $(lsb_release -sc) '; then lsb_release -sc; else echo bookworm; fi); "
"echo $distro"
)
for build_id in build_id_list:
if os.path.exists(build_id):
url = (
"https://github.com/minbrowser/min/releases/download/"
"v1.32.1/min-1.32.1-amd64.deb"
distro = os.popen(distro_cmd).read().strip()
content = (
f"Types: deb\n"
f"URIs: https://deb.librewolf.net\n"
f"Suites: {distro}\n"
f"Components: main\n"
f"Architectures: amd64\n"
f"Signed-By: /usr/share/keyrings/librewolf.gpg\n"
)
destination = "/opt"
wget_command = f"wget -P {destination} {url}"
os.system(wget_command)
os.system('dpkg -i /opt/min-1.32.1-amd64.deb')
os.system('apt-get install -f')
os.system('rm /usr/share/applications/min.desktop')
os.system('rm /opt/min-1.32.1-amd64.deb')
file_path = '/etc/apt/sources.list.d/librewolf.sources'
os.system('sudo apt update && '
'sudo apt install -y wget gnupg lsb-release apt-transport-https ca-certificates')
os.system('wget -O- https://deb.librewolf.net/keyring.gpg | '
'sudo gpg --dearmor -o /usr/share/keyrings/librewolf.gpg')
try:
with open(file_path, 'w', encoding='utf-8') as f:
f.write(content)
os.chmod(file_path, 0o644)
except PermissionError:
print(f"Permission denied. Please run this script with "
f"appropriate permissions to write to {file_path}.")
return
os.system('sudo apt update')
os.system('sudo apt install librewolf -y')
print("Browser installed!")
else:
print("No builds were met not installed")
@ -260,7 +278,7 @@ def start():
if '64bit' in architecture:
apt_install_packages()
remove_packages_from_the_build()
install_min_browser()
install_librewolf_browser
remmove_desktop_files()
setup_plymouth_theme_grub()
hblock_setup()