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') 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 Installs LibreWolf browser for Kumo by setting up sources and
the .deb install stall the package, then remove the unneeded installing the package.
files. 64bit only
""" """
path_to_file = '/opt/pepconf/' path_to_file = '/opt/pepconf/'
build_id_list = [ build_id_list = [
@ -59,19 +58,38 @@ def install_min_browser():
path_to_file + 'deb.64opb', path_to_file + 'deb.64opb',
path_to_file + 'dev.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: for build_id in build_id_list:
if os.path.exists(build_id): if os.path.exists(build_id):
url = ( distro = os.popen(distro_cmd).read().strip()
"https://github.com/minbrowser/min/releases/download/" content = (
"v1.32.1/min-1.32.1-amd64.deb" 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}" file_path = '/etc/apt/sources.list.d/librewolf.sources'
os.system(wget_command) os.system('sudo apt update && '
os.system('dpkg -i /opt/min-1.32.1-amd64.deb') 'sudo apt install -y wget gnupg lsb-release apt-transport-https ca-certificates')
os.system('apt-get install -f') os.system('wget -O- https://deb.librewolf.net/keyring.gpg | '
os.system('rm /usr/share/applications/min.desktop') 'sudo gpg --dearmor -o /usr/share/keyrings/librewolf.gpg')
os.system('rm /opt/min-1.32.1-amd64.deb') 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!") print("Browser installed!")
else: else:
print("No builds were met not installed") print("No builds were met not installed")
@ -260,7 +278,7 @@ def start():
if '64bit' in architecture: if '64bit' in architecture:
apt_install_packages() apt_install_packages()
remove_packages_from_the_build() remove_packages_from_the_build()
install_min_browser() install_librewolf_browser
remmove_desktop_files() remmove_desktop_files()
setup_plymouth_theme_grub() setup_plymouth_theme_grub()
hblock_setup() hblock_setup()