Update: Cleaned up Suggested

Signed-off-by: debianpepper <pdpdebdevuan@protonmail.com>
This commit is contained in:
debianpepper 2024-06-12 21:52:51 +09:00
parent 20f1b0646b
commit 627eafa771
3 changed files with 84 additions and 230 deletions

View File

@ -1,5 +1,5 @@
""" """
* Author: "PepDebian(peppermintosteam@proton.me) * Author: PepDebian (peppermintosteam@proton.me)
* *
* License: SPDX-License-Identifier: GPL-3.0-or-later * License: SPDX-License-Identifier: GPL-3.0-or-later
* *
@ -10,15 +10,12 @@ import subprocess
import tkinter as tk import tkinter as tk
import ttkbootstrap as ttk import ttkbootstrap as ttk
# Create the main window
pwin = ttk.Window(themename="peppermint") pwin = ttk.Window(themename="peppermint")
pwin.title("Suggested Packages") pwin.title("Suggested Packages")
pwin.resizable(False, False) pwin.resizable(False, False)
pwin.geometry('475x470') pwin.geometry('475x470')
pwin.tk.call('wm', 'iconphoto', pwin, tk.PhotoImage( pwin.tk.call('wm', 'iconphoto', pwin, tk.PhotoImage(file='/usr/share/pixmaps/peppermint-old.png'))
file='/usr/share/pixmaps/peppermint-old.png'))
notebook = ttk.Notebook(pwin) notebook = ttk.Notebook(pwin)
# Add some tabs to the notebook # Add some tabs to the notebook
@ -27,9 +24,9 @@ tab2 = ttk.Frame(notebook)
notebook.add(tab1, text="Tab 1") notebook.add(tab1, text="Tab 1")
notebook.add(tab2, text="Tab 2") notebook.add(tab2, text="Tab 2")
# Function to check if certain software packages are installed
def check_packages(): def check_packages():
""" Check if software is installed""" """ Check if software is installed """
if os.path.exists('/usr/bin/atril'): if os.path.exists('/usr/bin/atril'):
pdf_viewer['state'] = tk.DISABLED pdf_viewer['state'] = tk.DISABLED
if os.path.exists('/usr/bin/snap'): if os.path.exists('/usr/bin/snap'):
@ -40,16 +37,16 @@ def check_packages():
fire_wall['state'] = tk.DISABLED fire_wall['state'] = tk.DISABLED
if os.path.exists('/usr/bin/flatpak'): if os.path.exists('/usr/bin/flatpak'):
flatpak['state'] = tk.DISABLED flatpak['state'] = tk.DISABLED
# if os.path.exists('/usr/bin/timeshift'): if os.path.exists('/usr/bin/timeshift'):
# backup_tool['state'] = tk.DISABLED backup_tool['state'] = tk.DISABLED
if os.path.exists('/usr/bin/gnome-software'): if os.path.exists('/usr/bin/gnome-software'):
store['state'] = tk.DISABLED store['state'] = tk.DISABLED
if os.path.exists('/usr/bin/keepassxc'): if os.path.exists('/usr/bin/keepassxc'):
store['state'] = tk.DISABLED pwd_tool['state'] = tk.DISABLED
# Function to check if certain web browsers are installed
def check_web_browsers(): def check_web_browsers():
""" Check what browsers are installed""" """ Check what browsers are installed """
if os.path.exists('/usr/bin/firefox'): if os.path.exists('/usr/bin/firefox'):
fire_fox['state'] = tk.DISABLED fire_fox['state'] = tk.DISABLED
if os.path.exists('/usr/bin/konqueror'): if os.path.exists('/usr/bin/konqueror'):
@ -62,233 +59,104 @@ def check_web_browsers():
chromium_web['state'] = tk.DISABLED chromium_web['state'] = tk.DISABLED
if os.path.exists('/usr/bin/epiphany-browser'): if os.path.exists('/usr/bin/epiphany-browser'):
gnome_web['state'] = tk.DISABLED gnome_web['state'] = tk.DISABLED
if os.path.exists('/usr/bin/gnome-software'):
store['state'] = tk.DISABLED
# Functions to install packages
def install_package(package_name, check_function):
""" Generic function to install a package and check installation status """
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install", package_name])
check_function()
# ***Install Packages***
def install_atril(): def install_atril():
""" Install atril """ install_package("atril", check_packages)
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"atril"]
)
check_packages()
def install_keepass(): def install_keepass():
""" Install KeePass """ install_package("keepassxc", check_packages)
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"keepassxc"]
)
check_packages()
def install_parole(): def install_parole():
""" Install parole """ install_package("parole", check_packages)
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"parole"]
)
check_packages()
def install_gufw(): def install_gufw():
""" Install gufw """ install_package("gufw", check_packages)
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"gufw"]
)
check_packages()
def install_snap(): def install_snap():
""" Install install snap""" install_package("snapd", check_packages)
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"snapd"]
)
check_packages()
def install_flatpak(): def install_flatpak():
""" Install flatpak """ install_package("flatpak", check_packages)
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"flatpak"]
)
check_packages()
def install_store(): def install_store():
""" Install gnome store""" install_package("gnome-software", check_packages)
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"gnome-software"]
)
check_packages()
def install_timeshift(): def install_timeshift():
""" Install timeshift""" install_package("timeshift", check_packages)
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"timeshift"]
)
check_packages()
# ***Web browser defs***
def install_firefox(): def install_firefox():
""" Install firefox-esr """ install_package("firefox-esr", check_web_browsers)
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"firefox-esr"]
)
check_web_browsers()
def install_konqueror(): def install_konqueror():
""" Install konqueror """ install_package("konqueror", check_web_browsers)
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"konqueror"]
)
check_web_browsers()
def install_epiphany(): def install_epiphany():
""" Install epiphany-browser """ install_package("epiphany-browser", check_web_browsers)
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"epiphany-browser"]
)
check_web_browsers()
def install_tor(): def install_tor():
""" Install torbrowser-launcher """ install_package("torbrowser-launcher", check_web_browsers)
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"torbrowser-launcher"]
)
check_web_browsers()
def install_qute(): def install_qute():
""" Install install qutebrowser""" install_package("qutebrowser", check_web_browsers)
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"qutebrowser"]
)
check_web_browsers()
def install_chromium(): def install_chromium():
""" Install chromium""" install_package("chromium", check_web_browsers)
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"chromium"]
)
check_web_browsers()
def install_falkon(): def install_falkon():
""" Install falkon""" install_package("falkon", check_web_browsers)
subprocess.Popen(["x-terminal-emulator", "-e", "sudo", "apt", "install",
"falkon"]
)
check_web_browsers()
# Function to set up the software installation options based on the OS
def check_base_snaps(): def check_base_snaps():
""" If Devuan is loaded do not show snaps """ """ If Devuan is loaded do not show snaps """
global flatpak, store, backup_tool, pwd_tool, snap
if os.path.exists("/etc/devuan_version"): if os.path.exists("/etc/devuan_version"):
flatpak = ttk.Button(software_frame, flatpak = ttk.Button(software_frame, text="Flatpak Package Platform", cursor="hand2", style="danger", command=install_flatpak)
text="Flatpak Package Platform", flatpak.grid(row=4, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
cursor="hand2", style="danger",
command=install_flatpak store = ttk.Button(software_frame, text="Gnome Software Store", cursor="hand2", style="danger", command=install_store)
) store.grid(row=5, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
flatpak.grid(row=4, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew' backup_tool = ttk.Button(software_frame, text="TimeShift: Backup Tool", cursor="hand2", style="danger", command=install_timeshift)
) backup_tool.grid(row=6, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
store = ttk.Button(software_frame,
text="Gnome Software Store", pwd_tool = ttk.Button(software_frame, text="KeePassXC: Password Tool", cursor="hand2", style="danger", command=install_keepass)
cursor="hand2", style="danger", pwd_tool.grid(row=7, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
command=install_store
)
store.grid(row=5, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
backup_tool = ttk.Button(software_frame,
text="TimeShift: Backup Tool",
cursor="hand2", style="danger",
command=install_keepass
)
backup_tool.grid(row=7, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
pwd_tool = ttk.Button(software_frame,
text="KeePassXC: Password Tool",
cursor="hand2", style="danger",
command=install_timeshift
)
pwd_tool.grid(row=6, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
elif os.path.exists("/etc/debian_version"): elif os.path.exists("/etc/debian_version"):
snap = ttk.Button(software_frame, snap = ttk.Button(software_frame, text="Snap Package Platform", cursor="hand2", style="danger", command=install_snap)
text="Snap Package Platform", snap.grid(row=4, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
cursor="hand2", style="danger",
command=install_snap flatpak = ttk.Button(software_frame, text="Flatpak Package Platform", cursor="hand2", style="danger", command=install_flatpak)
) flatpak.grid(row=5, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
snap.grid(row=4, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew' store = ttk.Button(software_frame, text="Gnome Software Store", cursor="hand2", style="danger", command=install_store)
) store.grid(row=6, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
flatpak = ttk.Button(software_frame,
text="Flatpak Package Platform", backup_tool = ttk.Button(software_frame, text="TimeShift: Backup Tool", cursor="hand2", style="danger", command=install_timeshift)
cursor="hand2", style="danger", backup_tool.grid(row=7, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
command=install_flatpak
)
flatpak.grid(row=5, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
store = ttk.Button(software_frame,
text="Gnome Software Store",
cursor="hand2", style="danger",
command=install_store
)
store.grid(row=6, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
backup_tool = ttk.Button(software_frame,
text="TimeShift: Backup Tool",
cursor="hand2", style="danger",
command=install_timeshift
)
backup_tool.grid(row=7, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
# Create and organize the layout
# *** Below here is the layout of the forms***
# Frame that managed the Welcome To Peppermint Section
fsw = ttk.Frame(pwin, width=200) fsw = ttk.Frame(pwin, width=200)
fsw.grid(row=2, column=0, columnspan=4) fsw.grid(row=2, column=0, columnspan=4)
software_frame = ttk.Labelframe(fsw, bootstyle="dark", software_frame = ttk.Labelframe(fsw, bootstyle="dark", text="Suggested Software")
text="Suggested Software" software_frame.grid(row=5, column=0, columnspan=2, ipadx=0, ipady=0, padx=10, pady=10)
)
software_frame.grid(row=5, column=0, columnspan=2, ipadx=0, ipady=0,
padx=10, pady=10
)
# Buttons for the suggested software # Buttons for the suggested software
pdf_viewer = ttk.Button(software_frame, text="Atril: a document viewer", pdf_viewer = ttk.Button(software_frame, text="Atril: a document viewer", cursor="hand2", style="danger", command=install_atril)
cursor="hand2", style="danger", command=install_atril pdf_viewer.grid(row=0, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
)
pdf_viewer.grid(row=0, column=0, ipadx=5, ipady=5, padx=5, pady=5, media_player = ttk.Button(software_frame, text="Parole: Media Player", cursor="hand2", style="danger", command=install_parole)
sticky='ew' media_player.grid(row=2, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
)
media_player = ttk.Button(software_frame, text="Parole: Media Player", fire_wall = ttk.Button(software_frame, text="gufw: GNU Firewall", cursor="hand2", style="danger", command=install_gufw)
cursor="hand2", style="danger", command=install_parole fire_wall.grid(row=3, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
)
media_player.grid(row=2, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
fire_wall = ttk.Button(software_frame, text="gufw: GNU Firewall",
cursor="hand2", style="danger", command=install_gufw
)
fire_wall.grid(row=3, column=0, ipadx=5, ipady=5, padx=5, pady=5,
sticky='ew'
)
# Frame that manages the Browser buttons # Frame that manages the Browser buttons
fs = ttk.Frame(pwin) fs = ttk.Frame(pwin)
fs.grid(row=2, column=5, columnspan=2, ipadx=0, ipady=0, padx=10, pady=10) fs.grid(row=2, column=5, columnspan=2, ipadx=0, ipady=0, padx=10, pady=10)
@ -298,47 +166,31 @@ soc = ttk.Labelframe(fs, bootstyle="dark", text="Suggested Web Browsers")
soc.grid(row=5, column=0, columnspan=2, ipadx=0, ipady=0, padx=10, pady=10) soc.grid(row=5, column=0, columnspan=2, ipadx=0, ipady=0, padx=10, pady=10)
# Web Browser Buttons # Web Browser Buttons
fire_fox = ttk.Button(soc, text="Firefox ESR Browser", cursor="hand2", fire_fox = ttk.Button(soc, text="Firefox ESR Browser", cursor="hand2", style="danger", command=install_firefox)
style="danger", command=install_firefox
)
fire_fox.grid(row=0, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew') fire_fox.grid(row=0, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
kde_web = ttk.Button(soc, text="Konqueror KDE Browser", cursor="hand2", kde_web = ttk.Button(soc, text="Konqueror KDE Browser", cursor="hand2", style="danger", command=install_konqueror)
style="danger", command=install_konqueror
)
kde_web.grid(row=1, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew') kde_web.grid(row=1, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
gnome_web = ttk.Button(soc, text="Gnome Web(Epiphany)", cursor="hand2", gnome_web = ttk.Button(soc, text="Gnome Web (Epiphany)", cursor="hand2", style="danger", command=install_epiphany)
style="danger", command=install_epiphany
)
gnome_web.grid(row=2, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew') gnome_web.grid(row=2, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
tor_web = ttk.Button(soc, text="Tor Browser: Privacy", cursor="hand2", tor_web = ttk.Button(soc, text="Tor Browser: Privacy", cursor="hand2", style="danger", command=install_tor)
style="danger", command=install_tor
)
tor_web.grid(row=3, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew') tor_web.grid(row=3, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
qute_web = ttk.Button(soc, text="Qutebrowser: Vim-like ", cursor="hand2", qute_web = ttk.Button(soc, text="Qutebrowser: Vim-like", cursor="hand2", style="danger", command=install_qute)
style="danger", command=install_qute
)
qute_web.grid(row=4, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew') qute_web.grid(row=4, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
chromium_web = ttk.Button(soc, text="Chromium Browser", cursor="hand2", chromium_web = ttk.Button(soc, text="Chromium Browser", cursor="hand2", style="danger", command=install_chromium)
style="danger", command=install_chromium chromium_web.grid(row=5, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
)
chromium_web.grid(row=6, column=0, ipadx=5, ipady=5, padx=5, pady=5, falkon_web = ttk.Button(soc, text="Falkon Qt Browser", cursor="hand2", style="danger", command=install_falkon)
sticky='ew' falkon_web.grid(row=6, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
)
falkon_web = ttk.Button(soc, text="Falkon Qt Browser", cursor="hand2", lblpmtitle = ttk.Label(pwin, style="F62817.TLabel", text='These suggestions are listed in the official repositories')
style="danger", command=install_falkon lblpmtitle.place(x=5, y=440)
)
falkon_web.grid(row=7, column=0, ipadx=5, ipady=5, padx=5, pady=5, sticky='ew')
lblpmtitle = ttk.Label(pwin, style="F62817.TLabel",
text='These suggestions are listed in the official'
' repositories'
).place(x=5, y=440)
check_base_snaps() check_base_snaps()
#check_packages() check_packages()
check_web_browsers() check_web_browsers()
pwin.mainloop() pwin.mainloop()

View File

@ -425,6 +425,7 @@ GRUB_LIST_32 = ('efibootmgr\n'
'grub-efi-ia32-bin\n' 'grub-efi-ia32-bin\n'
'os-prober\n' 'os-prober\n'
'shim-helpers-i386-signed\n' 'shim-helpers-i386-signed\n'
'luakit\n' # Temp location for the 32bit need
) )
# Firmware packages shared by 32 adn 64 bit # Firmware packages shared by 32 adn 64 bit

View File

@ -146,6 +146,7 @@ class ChrootInstallerFiles:
for base in bases: for base in bases:
cls(base) cls(base)
# Execute the copy for all bases # Execute the copy for all bases
if __name__ == "__main__": if __name__ == "__main__":
ChrootInstallerFiles.run_for_all_bases() ChrootInstallerFiles.run_for_all_bases()